Results 1 to 8 of 8

Thread: Cross browser Marquee script

  1. #1
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cross browser Marquee script

    Can anybody tell me if there's probably a maximum length of the contents in the Cross browser Marquee script? I've just tried it and it works fine in IE, NS, Mozilla, but in the Opera browser (current version) it gets cut off at a certain position and starts from zero again...

  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

    Quote Originally Posted by Black Panther
    Can anybody tell me if there's probably a maximum length of the contents in the Cross browser Marquee script? I've just tried it and it works fine in IE, NS, Mozilla, but in the Opera browser (current version) it gets cut off at a certain position and starts from zero again...
    Sounds like you've answered your own question. The only way to tell for sure is to setup the script on an otherwise blank page, if you haven't already done so, and see if the problem in Opera persists. Also, I've found that with many of these type of scripts in Opera, it can help to put an additional div around the the whole thing:

    <div style="position:relative;overflow:hidden;">

    script or script's markup goes here

    </div>

    By "script or script's markup goes here", I mean the part of the script that generates its containers (often can be the entire script) or its HTML portion that hard codes them (whichever it has). I cannot be more specific because I am not certain which script you are talking about.

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.
    - John
    ________________________

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

  3. #3
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've used this one: http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm

    The result with an otherwise blank page was the same... in Opera it was cut off... and putting <div> around it didn't help either...

  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

    Well, how long is too long?

    Please post a link to the page on your site that contains the problematic script so we can check it out.
    - John
    ________________________

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

  5. #5
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the entire text is 187 characters long... and it gets cut off in Opera at around 100 or 105...

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

    I just did one that was only a little shy of 1800 characters, no problem in Opera. Somewhere higher, around 4000 characters? (when I went that high) it appeared to wrap once inside the little light cyan slot there that it runs in. Here is a demo of @1800 characters. I've set it to stop at the end, and it appears to go all the way through. Find something interesting to do while you are waiting for it to scroll through.
    - John
    ________________________

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

  7. #7
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    that's really strange... did you use a different script or something?
    Is it possible that you post that maybe?

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

    It is the same script you referenced, including the now deprecated language attribute and missing the now technically 'required' type attribute. The only difference from the original is that I did wrap it in a division:

    Code:
    <div style="position:relative;overflow:hidden;"><script language="JavaScript1.2">
    
    /*
    Cross browser Marquee script- © Dynamic Drive (www.dynamicdrive.com)
    For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
    Credit MUST stay intact
    */
    
    //Specify the marquee's  . . .
    
    
     . . .}
    document.write('</td></table>')
    }
    }
    </script></div>
    All that did (I think) was get rid of the horizontal scrollbar from the bottom of the page. I also, of course, changed the maequeecontent variable to:

    Code:
    var marqueecontent='<nobr><font face="Arial">Lorem ipsum d . . . neque nonor et</font></nobr>'
    And, I changed the scrollmarquee function to (additions red):

    Code:
    function scrollmarquee(){
    if (iedom){
    if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
    cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
    else {
    clearInterval(lefttime)
    return;
    cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
    }
    
    }
    else if (document.layers){
    if (ns_marquee.left>(actualwidth*(-1)+8))
    ns_marquee.left-=copyspeed
    else
    ns_marquee.left=parseInt(marqueewidth)+8
    }
    }
    All that does is make it stop at the end of the first pass.

    You can use your browser's 'view source' to see the entire markup and script. I'm thinking that there may be something about your marqueecontent variable that caused the problem. Perhaps a syntax error or, a line break. The entire marqueecontent variable must be on a single line in the source code.

    Please post a link to the page on your site that contains the problematic script so we can check it out.
    - 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
  •