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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top