Results 1 to 3 of 3

Thread: Special Document Effects Stop Button?

  1. #1
    Join Date
    Mar 2005
    Location
    New Zealand
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Special Document Effects Stop Button?

    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!)

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default Modded This Up just now

    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:

    Code:
    setTimeout('fall()',20);
    to this:
    Code:
    falling=setTimeout('fall()',20);
    add this function:

    Code:
    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:
    Code:
    window.onload=fall
    add this button to your page:
    HTML Code:
    <input type="button" value="Stop Leaves" onClick="stop_leaves();">
    Last edited by jscheuer1; 03-18-2005 at 06:27 AM. Reason: Correction

  3. #3
    Join Date
    Mar 2005
    Location
    New Zealand
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Many many thanks!!!

    EXACTLY what I wanted - works like a dream for me here - you are wonderful!!

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

    Lisa Wood
    Spouting Clean Plus+

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •