homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

javascript on/off link
placing a link to turn the javascript effect on/off

Msg#: 4399022 posted 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?



5+ Year Member

Msg#: 4399022 posted 1:32 am on Dec 23, 2011 (gmt 0)

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.


Msg#: 4399022 posted 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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved