Scrolling code

Code rolling up (rolling followed by finish rolling up once) when in contact with the mouse automatically stop.
<MARQUEE behavior="scroll"    
onmouseover=this.stop(); onmouseout=this.start(); scrollAmount=2 scrollDelay=10    
direction=up height=168 width="177">
< DIV align=center >    
< TABLE >
< TBODY > < TR >    
< TD >
< p > < a href ="http://www.ybj86.cn" target ="_blank" >四季情缘 </a> </p>
< p > < a href ="http://blog.ybj86.cn" target ="_blank" > < a href ="http://blog.ybj86.cn" target ="_blank" >我们的天堂 </a> </a> </p>        
< p > < a href ="http://www.year80.cn" target ="_blank"> 80s Forum </a> </ p>
<the p-> <A href = "http://vip.year80.cn" target = "_ blank"> 80 years of integrated community </a> </ p>
< p > < a href ="http://www.coldyu.com" target ="_blank" >冷雨技术论坛 </a> </p>
< p > < a href ="http://www.baidu.com" target ="_blank" >百度搜索 </a> </p>    
< p > < a href ="http://www.google.com" target ="_blank" >GOOGLE搜索 </a> </p>                        
</TD>    
</TR>
</TBODY>
</TABLE>
</DIV> </MARQUEE>
Description: in which direction = up to control the direction of scrolling, you can use the left, right and down instead. scrollamount property of the subtitle scrolling speed. scrolldelay property is set to pause when scrolling marquee content time, in milliseconds. behavior marquee content of exercise, you can use alternate content to roll in two opposite directions, scroll to scroll content in the same direction, slide the contents come into contact with the caption border to stop scrolling.
 
 
 
Continuous cycle scroll up code (continuous rolling) when in contact with the mouse will automatically stop.
<Div id = "marquees"> <-! These are the contents of subtitles, you can be arbitrarily defined ->
<the p-> <A href = "http://www.ybj86.cn" target = "_ blank"> Four Seasons Love </a> </ P>
<P> <A the href = "http://blog.ybj86.cn" target = "_ blank"> <A the href = "http://blog.ybj86.cn" target = "_blank"> our paradise </a> </a> </ the p->        
<the p-> <a href = "http://www.year80.cn" target = "_ blank"> 80 years </a> Forum </ the p->
<the p-> <A href = "http://vip.year80.cn" target = "_ blank"> 80 years of integrated community </a> </ the p->
<the p-> <A href = "HTTP: //www.coldyu.com "target =" _ blank " > rain technology Forum </a> </p>
< p > < a href ="http://www.baidu.com" target ="_blank" >百度搜索 </a> </p>    
< p > < a href ="http://www.google.com/" target ="_blank" >GOOGLE搜索 </a> </p>
</div>    
<! - The following is a javascript code ->
<Script Language = "javascript">
<! -
marqueesHeight = 200 is; // height content area
stopscroll = false; // this variable controls whether to stop scrolling
with (marquees) {
the noWrap = true; // sentence table of contents region does not wrap
style.width = 0; // so we can set its width to 0, as it will be stretch
style.height = marqueesHeight;
style.overflowY = "hidden "; // scroll bar is not visible
Function (" stopscroll = true ") ; // rollover, stop scrolling
Function (" stopscroll = false ") ; // mouse left and began rolling
}
// height this time, the content area can not be read. Output below an invisible layer "templayer", which will later be copied to the content:
document.write ( '<div ID = "templayer" style = "position: Absolute; Z-index:. 1; visibility:
function init () {// Initialization scrolling the content
// multiple copy of the original contents to the "templayer", until "templayer" a height greater than the height of the content area:
the while (templayer.offsetHeight <marqueesHeight) {
templayer.innerHTML + = marquees.innerHTML;
} // the content of "templayer" of "double" copy back to the original content area:
marquees.innerHTML = templayer.innerHTML + templayer.innerHTML;
// set of consecutive timed call "scrollUp ()" function driven scroll bar:
setInterval ( "scrollUp ()", 20 is);
}
the document.body.
preTop = 0; // this variable for determining whether the scroll bar has come to an end
function scrollUp () {// scrollbar drive function
if (stopscroll == true ) return; // If the variable "stopscroll" is true, then the stop scrolling    
preTop = marquees.scrollTop; // record the position before the scroll bar to scroll
marquees.scrollTop + = 1; // scroll bar has moved down by one pixel
// If not move the scroll bar, and then scroll up to the same position of the current picture
// Moreover, of course, the same also scroll down a pixel (+ 1'd):
IF (preTop == marquees.scrollTop) {
marquees. + = templayer.offsetHeight-marqueesHeight scrollTop. 1;
}
}
->
</ Script>

Reproduced in: https: //my.oschina.net/lichen/blog/264862

Guess you like

Origin blog.csdn.net/weixin_34166847/article/details/91817229