Vertically scrolling text - how far up to scroll it?

D

Danny@Kendal

On my main web page I have a vertically scrolling text box containing latest
information.
I use a moving <div> clipped inside a fixed <div> to give the appearance of
scrolling text.

Currently the text is manually entered and of a fixed font size so I know
how far up to move the <div> to give the appearance of text scrolling off
the top of the scrolling display area.
Is there a simple way to ensure the last line of text has scrolled out of
sight no matter how many lines of text or what font size is used?
I'm asking because I want to auto-generate the scrolling text and though it
would be possible to also auto-generate the upper and lower scrolling limits
I'd prefer a more elegant solution.

I use the following javascript scrolling function:

function newsScroller()
{
document.getElementById("scroller").style.top = scrollPos
scrollPos=scrollPos - scrollStep
if (scrollPos<upperLimit)
{
scrollPos=lowerLimit
}
setTimeout("newsScroller()",timeDelay)
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top