Results 1 to 4 of 4

Thread: Fading Scroller - make it wait a second!!!

  1. #1
    Join Date
    Apr 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Fading Scroller - make it wait a second!!!

    1) Script Title: Fading Scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...fadescroll.htm

    3) Describe problem:
    Hi wonderful people

    I'd like to know if there's a way to make the fading scroller script hold off appearing on a page. Basically I've got a flash animation that takes about 10 sec to appear so to have two things flashing at once is a bit scary! Can anyone tell me if I can modify the code to have the scroller pause on page load? Or even appear as normal text, then have a <back next> button so users can see the next text at their leisure?

    Many thanks in advance

    Mrs Spence

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Give the begin tag an id, such as "myTag", and set it's style to display:none.
    Place this in the body:
    Code:
    <script type="text/javascript">
    var delay = 10000 // seconds
    var el = document.getElementById("myTag");
    setTimeout("el.style.display = 'block'",delay);
    </script>
    Hope this helps.
    - Mike

  3. #3
    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

    Untested:

    To start it with a delay, change this:

    Code:
    if (window.addEventListener)
    window.addEventListener("load", changecontent, false)
    else if (window.attachEvent)
    window.attachEvent("onload", changecontent)
    else if (document.getElementById)
    window.onload=changecontent
    to:

    Code:
    function startWithDelay(){
    setTimeout("changecontent()", 10000);
    }
    
    if (window.addEventListener)
    window.addEventListener("load", startWithDelay, false)
    else if (window.attachEvent)
    window.attachEvent("onload", startWithDelay)
    else if (document.getElementById)
    window.onload=startWithDelay
    The red 10000 is the number of milliseconds delay, 10000=10 seconds.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    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

    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •