/    Sign up×
Community /Pin to ProfileBookmark

Scrolling Text Problem

Hello,

I’m currently working on making a section of text scroll from the bottom of a table to the top. For now the text are numbers ranging from 1-20. I have the code taken from the web below, and it works fine.

<body>

<table width=”200″ border=”2″ cellspacing=”0″ cellpadding=”0″ bordercolor=”#0000CC”>
<tr>
<td>

<script language=”JavaScript1.2″>

// Scrollers width here (in pixels)
var scrollerwidth=”200px”

// Scrollers height here
var scrollerheight=”300px”

// Scrollers speed here (larger is faster 1-10)
var scrollerspeed=6

// Scrollers content goes here! Keep all of the message on the same line!
var scrollercontent='<center><font face=”Arial” color=”green” size=”5″>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20</font><center>’

var pauseit=1

// Change nothing below!
scrollerspeed=(document.all)? scrollerspeed : Math.max(1, scrollerspeed-1) //slow speed down by 1 for NS
var copyspeed=scrollerspeed
var iedom=document.all||document.getElementById
var actualheight=”
var cross_scroller, ns_scroller
var pausespeed=(pauseit==0)? copyspeed: 0

function populate(){
if (iedom){
cross_scroller=document.getElementById? document.getElementById(“iescroller”) : document.all.iescroller
cross_scroller.style.top=parseInt(scrollerheight)+8+”px”
cross_scroller.innerHTML=scrollercontent
actualheight=cross_scroller.offsetHeight
}
else if (document.layers){
ns_scroller=document.ns_scroller.document.ns_scroller2
ns_scroller.top=parseInt(scrollerheight)+8
ns_scroller.document.write(scrollercontent)
ns_scroller.document.close()
actualheight=ns_scroller.document.height
}
lefttime=setInterval(“scrollscroller()”,20)
}
window.onload=populate

function scrollscroller(){

if (iedom){
if (parseInt(cross_scroller.style.top)>(actualheight*(-1)+8))
cross_scroller.style.top=parseInt(cross_scroller.style.top)-copyspeed+”px”
else
cross_scroller.style.top=parseInt(scrollerheight)+8+”px”
}
else if (document.layers){
if (ns_scroller.top>(actualheight*
(-1)+8))
ns_scroller.top-=copyspeed
else
ns_scroller.top=parseInt(scrollerheight)+8
}
}

if (iedom||document.layers){
with (document){
if (iedom){
write(‘<div style=”position:relative;width:’+scrollerwidth+’;height:’+scrollerheight+’;overflow:hidden” onMouseover=”copyspeed=pausespeed” onMouseout=”copyspeed=scrollerspeed”>’)
write(‘<div id=”iescroller” style=”position:absolute;left:0px;top:0px;width:100%;”>’)
write(‘</div></div>’)
}
else if (document.layers){
write(‘<ilayer width=’+scrollerwidth+’ height=’+scrollerheight+’ name=”ns_scroller”>’)
write(‘<layer name=”ns_scroller2″ width=’+scrollerwidth+’ height=’+scrollerheight+’ left=0 top=0 onMouseover=”copyspeed=pausespeed” onMouseout=”copyspeed=scrollerspeed”></layer>’)
write(‘</ilayer>’)
}
}
}

</script>

</td>
</tr>
</table>

</body>

My question is…how can I make the text scroll continuously so there are no gaps from when it finishes (number 20) to when it starts again (number 1)? Can anyone please help?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@AJames182authorMar 14.2006 — You can also see it from this link?

http://www.polyformes.co.uk/scrolling_text.html

Any ideas?
×

Success!

Help @AJames182 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...