The code is as follows:
div>
Marqueesheight = 200; // content area height
Stopscroll = false; // This variable control does it stop scrolling
With (marquees) {
NOWRAP = true; // This sentence area is not automatically wrapped
Style.Width = 0; //, we can set it to 0 because it will be large
Style.height = marqueesheight;
Style.Overflowy = "hidden"; // scroll bar is not visible
οnmοuseοver = new function ("stopscroll = true"); // mouse passes, stop scrolling
οnmοuseοut = New function ("stopscroll = false"); // mouse leaves, start scrolling
}
// At this time, the height of the content area cannot be read. The following output an invisible layer "templayer", copy the content to the inside later:
Document.write ('
Function init () {// Initialize scroll content
// Copy the original content multiple times to "TemPlayer" until "TemPlayer" is greater than the content area height:
While (TemPlayer.OffsetHeight Templayer.innerhtml = marques.innerhtml; } // twice the "twice" of "TemPlayer" to reply to the original content area: Marquees.innerhtml = TemPlayer.innerHtml Templayer.innerHTML; // Set up a continuous timeout, call the scrollup () "function drive the scroll bar: SETINTERVAL ("Scrollup ()", 20); } Document.body.οnlοad = init; PRETOP = 0; // This variable is used to determine if the scroll bar has arrived. Function scrollup () {// drive function of scroll bar If (stopscroll == true) return; // If the variable "stopscroll" is true, stop scrolling Pretop = marquees.scrolltop; // Record the scroll bar position before scrolling Marquees.scrolltop = 1; // Scroll Bar Moves a pixel // If the scroll bar is not moved, scroll up to the same position as the current picture. / / Of course not only, but also scroll down a pixel ( 1): IF (pretop == marques.scrolltop) { Marquees.scrolltop = TemPlayer.OffsetHeight-Marqueesheight 1; } } -> script> [Ctrl A " Transfer from: http://goaler.xicp.net/Article/showArticle.asp?id=197