Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Marquee help please

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

    Default Marquee help please

    1) Script Title: FF1+ IE5+ Opr7+ Cross Browser marquee

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm

    3) Describe problem:
    When the words scroll to the left side, it doesn't roll off of the marquee, it just sort of stops.
    Here is the code that I am using, altered to the use, of course.
    Thanks! I new to DD and love it...thanks folks.

    <p align="center"><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 width (in pixels)
    var marqueewidth="500px"
    //Specify the marquee's height
    var marqueeheight="50px"
    //Specify the marquee's marquee speed (larger is faster 1-10)
    var marqueespeed=2
    //configure background color:
    var marqueebgcolor=""
    //Pause marquee onMousever (0=no. 1=yes)?
    var pauseit=1

    //Specify the marquee's content (don't delete <nobr> tag)
    //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

    var marqueecontent='<nobr><font face="Arial"><b>Shading the homes of West Tennessee since 1999</b></font></nobr>'


    ////NO NEED TO EDIT BELOW THIS LINE////////////
    marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
    var copyspeed=marqueespeed
    var pausespeed=(pauseit==0)? copyspeed: 0
    var iedom=document.all||document.getElementById
    if (iedom)
    document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
    var actualwidth=''
    var cross_marquee, ns_marquee

    function populate(){
    if (iedom){
    cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
    cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
    cross_marquee.innerHTML=marqueecontent
    actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
    }
    else if (document.layers){
    ns_marquee=document.ns_marquee.document.ns_marquee2
    ns_marquee.left=parseInt(marqueewidth)+8
    ns_marquee.document.write(marqueecontent)
    ns_marquee.document.close()
    actualwidth=ns_marquee.document.width
    }
    lefttime=setInterval("scrollmarquee()",20)
    }
    window.onload=populate

    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
    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
    }
    }

    if (iedom||document.layers){
    with (document){
    document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
    if (iedom){
    write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
    write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
    write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
    write('</div></div>')
    }
    else if (document.layers){
    write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
    write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
    write('</ilayer>')
    }
    document.write('</td></table>')
    }
    }
    </script>

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    It seems to work fine for me with the code you posted above (tested in IE6, IE7, and FF 2.0.0.3). To see what I mean, go to http://phphost.smackum.com/dd/marquee.html.

    A link to your problem page would help us out in determining whether or not it is something else on your page that is conflicting with the script.

    Anyways, hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Apr 2007
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    If you promise not to laugh at me, I'll show you:
    http://jacksoncustomblinds.com/

    I'm new at this, so....just look the other way and don't laugh in my face. I'm learning.

    Your link it worked perfect like I want it to.
    hmmm, I dunno.
    HELP!
    hahah,
    Ty,
    Mark

  4. #4
    Join Date
    Apr 2007
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    anybody have any suggestions??? about the marquee stopping before it finishes the page??
    Thanks!

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

    Get rid of the red part:

    Code:
    <p align="center"><script language="JavaScript1.2">
    But, this will make the marquee off center. So, in the script add this (green):

    Code:
    if (iedom||document.layers){
    with (document){
    document.write('<table align="center" border="0" cellspacing="0" cellpadding="0"><td>')
    if (iedom){
    write('<div style="posit . . .
    - John
    ________________________

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

  6. #6
    Join Date
    Apr 2007
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    THANKS! I will try that tonite AND tone down the redness to a more burgundy..
    I'm learning, I know it is a simple page but I'd rather do simple pages right and clean..thank you very much for helping me.
    Enjoying the learning,
    Mark

  7. #7
    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 didn't mean that the red color on your page was bad. I meant the red highlighted part in the code segment that I was showing you. But, now that you mention it, a gray colored border might look better.
    - John
    ________________________

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

  8. #8
    Join Date
    Apr 2007
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Yea, I agree. The owner wanted a lot of red in it since he his log has red. But, actually the logo is more of a burgundy. So that'll help.

  9. #9
    Join Date
    Apr 2007
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Ok, that fixed it perfectly. THANK YOU. HE didn't care, but I did.
    What I'd like to do is save that exact script as a source file, like I would a jpeg, then insert it as needed. Also, if I wanted to change the marquee text, it would change ALL of the pages that used it..right?? If I changed the source jscript file?
    Can anyone tell me how to save that script and use it like that? also, how do I script where its referenced to? I know where the file is, but what script do I write to reference to the source?
    Thanks for helping me,
    Mark

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

    You can do that. Put the code without the tags (get rid of these):

    HTML Code:
    <script language="JavaScript1.2">
    and:

    HTML Code:
    </script>
    in a text file, save it as - say, marquee.js

    Then use this in its place on the page and wherever else you want it to appear:

    HTML Code:
    <script src="marquee.js" type="text/javascript">
    /*
    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
    */
    </script>
    Note: Just like a jpeg, if it isn't in the same directory as the page that is using it, you need to provide the path as well as the filename in the src attribute.
    - 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
  •