PDA

View Full Version : Special Document Effects Stop Button?



LWood
03-17-2005, 08:04 PM
SCRIPT: Autumn Leaves
http://dynamicdrive.com/dynamicindex3/leaves.htm

I work for a spouting cleaning company and this is an excellent script for a gutter protection product we make. However the boss has asked if there is a way to create a button a viewer can click on to stop the script and have the leaves not show any more?

I understand they can turn off certain options for their particular browser but as New Zealand is yonks behind everyone else in computer use knowledge - this is not an option - he just wants a one click stop option...

If you can help with a link or scripty bit - you will have my eternal gratitude...

:)

Lisa Wood
Spouting Clean Plus+
Auckland, New Zealand
(who will be linking back for you!)

jscheuer1
03-18-2005, 05:58 AM
Others may want to comment, I'm not sure of the syntax for NS prior to NS6, but, here's the mod, works in IE6 and NS7.2:

Change this line in the script:


setTimeout('fall()',20);to this:

falling=setTimeout('fall()',20);

add this function:


function stop_leaves(){
clearTimeout(falling);
for (i=0; i < Amount; i++){
if (ns){
document.layers['sn'+i].visibility='hide'}
else if (ns6){
document.getElementById("si"+i).style.display='none'}
else{
document.all['si'+i].style.display='none'}
}
}just above the line:

window.onload=fall
add this button to your page:

<input type="button" value="Stop Leaves" onClick="stop_leaves();">

LWood
03-21-2005, 01:34 AM
EXACTLY what I wanted - works like a dream for me here - you are wonderful!! :D

Instructions for us non-java people are clear and idiot proof - great stuff...

Lisa Wood
Spouting Clean Plus+