
Originally Posted by
ddadmin
Another good reason to supply the link to the script - unless I am mistaken, the OP is using the snow without images script not the one with images you just so artfully answered his question for. Don't feel bad, I've been doing a bit of that lately. Also the OP wanted, I think, to be able to turn it back on. I came up with this mod of the snow.js file that comes with 'Snow Effect without images' - at the very end of snow.js where it looks like so:
Make it like so (additions red):
Code:
})();
}
function setFlakes(el){
var val=el.value? el.value : el.innerHTML
var hf=document.getElementsByTagName('div')
for (var i_tem = 0; i_tem < hf.length; i_tem++)
if (hf[i_tem].id.indexOf('flake')!==-1)
hf[i_tem].style.display=val=="Stop Snow"? 'none' : ''
if(el.value)
el.value=val=="Stop Snow"? 'Start Snow' : 'Stop Snow'
else
el.innerHTML=val=="Stop Snow"? 'Start Snow' : 'Stop Snow'
}//End.
Then put this link on your page:
HTML Code:
<a href="#" onclick="setFlakes(this);return false;">Stop Snow</a>
OR this snazzy button (don't use both):
HTML Code:
<input id="control" type="button" value="Stop Snow" onclick="setFlakes(this);">
Bookmarks