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)
}
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)
}