Virtual Mechanics: Community Forums and FAQs
Virtual Mechanics: Community Forums and FAQs
WebDwarf, SiteSpinner, SiteSpinner Pro 'How do I...'
Scrolling Message|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Honorary Mechanic |
I have a scolling message script from Dynamic Drive on my home page. The problem is, the message cuts off the last couple of words before it starts to repeat the scroll. I have tried adding spaces, a line of periods, etc. and it doesn't seem to help. I can't see anywhere else where you can make any adjustments to the message. I would like it to scroll the last word off the left side of the page before it starts to repeat. I also don't know if there is a way to "close" the gap between the end of the message and the beginning of the repeat. Any help would be greatly appreciated. Thanks.
<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="592px" //Specify the marquee's height var marqueeheight="23px" //Specify the marquee's marquee speed (larger is faster 1-10) var marqueespeed=2 //configure background color: var marqueebgcolor="#CCCCCC" //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">Office hours are Monday-Friday 8:30am - 4:00pm. If you need to contact someone during non-business hours for a consumer in our Community Supports Program, dial the office number 317-299-6088 and enter ext. 689, for our Supported Living Program enter 654 and if you are calling to cancel a class, enter 623....The office will be closed on November 26th & 27th for Thanksgiving.</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> |
||
|
|
Honorary Mechanic |
Hi
I tried it exactly using the script as shown and it works as you wished. Tested on PC: XP pro IE6 Chrome Latest version Firefox Latest version Opera Latest version The fullstop(period) after thanksgiving disappears before it loops on all of them. Having them running all at the same time does reveal differences in the scrolling speed of browsers. Opera is the slowest. IE6 being the fastest I would question having so much text in a ticker. I doubt whether people will wait that long for what could be very important information right at the end of the text. I'd have the static content in a box on page and only the really important stuff, the Thanksgiving closure in the ticker. I don't know if anybody else can reproduce the problem you have. Sorry, can't help with the close up the gap question - beyond me. Cheers Andrew |
|||
|
|
Honorary Mechanic |
My PC is running Vista Home and my browser is IE6 if that helps.
|
|||
|
|
Guru 'Geezer' Mechanic |
I think I see the problem. I played around with some of the values and basically the problem boils down to your marquee width is too wide. The way this marquee works, when the last bit of info is displayed, there is a scheduled pause, and then the message restarts. Because the marquee width is so wide, the end of your message seems to "flash" off rather than scroll before restarting.
Due to the amount of text in your message, I can see why you need such a wide marquee. I agree with Andrew that this is too much text to use in a marquee (personally I hate scrolling phone numbers - if they are important, they should be static so people can see them). Perhaps your page can accommodate a multi-line vertical scroller. DynamicDrive has several: a pausing up-down scroller a cross-browser marquee 2 an i-frame scroller and others |
|||
|
|
Honorary Mechanic |
Thanks Larry. I agree on the scrolling numbers too, however, I didn't think this one was so bad because it pauses on mouseover. I will see what I can do to "streamline" things and make a better presentation of the information. Thanks for your help and suggestions as always.
|
|||
|
|
Guru 'Geezer' Mechanic |
I find the problem with marquess that pause with a mouse over is you depend on your visitor already knowing to do that. Are you sure your target audience does?
|
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|

