Welcome to WebmasterWorld Guest from 54.157.222.62

Forum Moderators: open

Message Too Old, No Replies

javascript on/off link

placing a link to turn the javascript effect on/off

   
5:13 pm on Dec 17, 2011 (gmt 0)



I have placed snow javascript on my site. But some complain that it lags. So i wanna provide a button....to turn the snow on/off (the whole script)
can someone help out?
1:32 am on Dec 23, 2011 (gmt 0)

5+ Year Member



Not without the code that adds the snow.

But before you give up on it, try to optimize it (or post it and let me give it a try :) ). I've actually faced your exact problem before: javascript snow that required a bit of optimization to run smoothly. In the end it worked well for everybody, even with nice effects like randomized drifting, accumulation, gusts, and, occasionally, santa claus flying across the screen.
4:18 am on Dec 23, 2011 (gmt 0)



I found how to disable the script. but now i have a new problem. I have two scripts and both use the same "snowStorm.stop();return false" to stop the snow. NOW when i place a link with that, only one of the scripts stop. (probably the one which is placed first)
Any idea how to stop both of the scripts.? you can see my site for getting into the js and the code. [airportwars.com...]

Also, i would love to know if i can store user's selection. Like when someone pressed the "turn off" button, the snow does not reappear when user opens another page. I mean to store the button action as cookie or something