PDA

View Full Version : Scroll not fully finishing



rsd17tech
11-17-2011, 02:54 PM
Attached is my script. I am having problems with the code where when I can read the last word of the text I want to display it just restarts the scroll where I want the last word to go all the way to the end. Almost like it rolls around. Any thoughts how to fix this issue?





/* Font Definitions */
@font-face
{font-family:Cambria;
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-536870145 1073743103 0 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;}
span.SpellE
{mso-style-name:"";
mso-spl-e:yes;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.WordSection1
{page:WordSection1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US style='tab-interval:.5in'>

<div class=WordSection1>

<div style='left:9px; position:absolute; top:14px' onMouseOver="scrollspeed=0"
onmouseout="scrollspeed=cache" id=datacontainer>

<p class=MsoNormal><span style='font-family:"Cambria","serif";mso-ascii-theme-font:
major-latin;mso-fareast-font-family:"Times New Roman";mso-hansi-theme-font:
major-latin;color:red'>There will be no soccer practice today…..and no
afterschool activities due to <span class=SpellE>imclimate</span> weather
coming in…that is all I am testing how long I can write END

</div>

<p class=MsoNormal><span style='font-family:"Cambria","serif";mso-ascii-theme-font:
major-latin;mso-fareast-font-family:"Times New Roman";mso-hansi-theme-font:
major-latin;color:red'><script type="text/javascript">

/***********************************************
* IFRAME Scroller script- C Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=2

//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=2000

function initializeScroller(){
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.left="5px"
setTimeout("getdataWidth()", initialdelay)
}

function getdataWidth(){
thelength=dataobj.offsetWidth
if (thelength==0)
setTimeout("getdataWidth()",10)
else
scrollDiv()
}

function scrollDiv(){
dataobj.style.left=parseInt(dataobj.style.left)-scrollspeed+"px"
if (parseInt(dataobj.style.left)<thelength*(-1))
dataobj.style.left="5px"
setTimeout("scrollDiv()",40)
}

if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller
</script><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>

ddadmin
11-18-2011, 10:10 AM
The script credit refers to "IFRAME scroller", though the actual code seems to be for another horizontal marquee script. Is your goal to scroll the text vertically up down, or horizontally (left/ right)? For the later there is Memory Scroller (http://www.dynamicdrive.com/dynamicindex2/memoryscroller.htm).