I'm trying to put a code snippet into an external .js. Works fine as is inside the page file but stops working if I pull out the script to an external file. I'm thinking it's a variable issue but I'm not entirely clear how to fix that. Little help. Thanks.
Here's the current working internal code:
<script src="scripts/jquery-1.12.4.min.js"></script>
<script src="scripts/jquery.flurry.js"></script>
<script>
$(document).ready(function(){
$("body").flurry({height:300,frequency:98,speed:4321,small:11,large:61,wind:40,windVariance:98,rotation:272,rotationVariance:98,
startOpacity:1,endOpacity:0,opacityEasing:"cubic-bezier(1,.3,.6,.74)",blur:true,overflow:"hidden",zIndex:9999});
$(".toggle-snow").on("click",function(event){
event.preventDefault();
try{
$("body").flurry("destroy");}
catch(err){
$("body").flurry();}
});
});
</script>
When I pull that third script into a fall.js file, the code stops working. Is there something that I need to add to the external script or the internal file?
-- Ah! Silly me. Needed to just remove the open / closing tag in the fall.js file.