Results 1 to 5 of 5

Thread: Fade Scroller skips

  1. #1
    Join Date
    Mar 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Fade Scroller skips

    Hi,
    I am using the following scroller - ->http://www.dynamicdrive.com/dynamici...fadescroll.htm on my homepages and the messages either skip or don't even get acknowledged. What do I need to do to get the messages to go in order? I have 2 onload events, so I disabled the window.onload=changecontent in the code and put it in the body tag along with the other onload event. Could that be causing the discrepancies?

  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

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

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

  3. #3
    Join Date
    Mar 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

  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

    OK, a problem here is that the script is already partially written to avoid conflicts onload. By commenting out just the last part of that language:
    Code:
    if (window.addEventListener)
    window.addEventListener("load", changecontent, false)
    else if (window.attachEvent)
    window.attachEvent("onload", changecontent)
    else if (document.getElementById)
    //window.onload=changecontent
    and adding the event onload to the body tag, you've created a situation where the event is either loaded twice or not at all, depending upon the browser used. I'd get rid of the onload event from the body tag and replace the entire code I've included above with:
    Code:
    if ( typeof window.addEventListener != "undefined" )
        window.addEventListener( "load", changecontent, false );
    else if ( typeof window.attachEvent != "undefined" ) {
        window.attachEvent( "onload", changecontent );
    }
    else {
        if ( window.onload != null ) {
            var oldOnload = window.onload;
            window.onload = function ( e ) {
                oldOnload( e );
                changecontent();
            };
        }
        else
            window.onload = changecontent;
    }
    This will get rid of that problem. There may be others but, this is probably it as concerns the 'Fading scroller' script.
    - John
    ________________________

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

  5. #5
    Join Date
    Mar 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you John.

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
  •