Seamless scrolling of jQuery classic code (favorites), seamless jquery
<Script language = "javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"> </script>
<Style type = "text/css"> img {border: none ;}</style>
<Div id = "demo">
<Table border = "0" align = "center" cellpadding = "1" cellspacing = "1" cellspace = "0">
<Tr>
<Td id = "demo1" valign = "top" bgcolor = "ffffff">
<! -- Note that the total width of the image below must be greater than the width of the demo defined above. For example, if the width of the demo above is 500 PX, the total width of the image below must be greater, otherwise, some problems may occur! -->
<Table border = "0" cellspacing = "0" cellpadding = "0">
<Tr align = "center">
<Td>
<A href = "#" target = "_ blank"> </a>
</Td>
<Td>
<A href = "#" target = "_ blank"> </a>
</Td>
<Td>
<A href = "#" target = "_ blank"> </a>
</Td>
<Td>
<A href = "#" target = "_ blank"> </a>
</Td>
<Td>
<A href = "#" target = "_ blank"> </a>
</Td>
</Tr>
</Table>
</Td>
<Td id = "demo2" valign = "top"> </td>
</Tr>
</Table>
</Div>
<Script type = "text/javascript"> var speed = 30; var demo = $ ("# demo"); var demo1 = $ ("# demo1 "); var demo2 = $ ("# demo2 ");
Demo2.html(demo1.html ());
Function Marquee () {if (demo. scrollLeft ()> = demo1.width () demo. scrollLeft (0); else {demo. scrollLeft (demo. scrollLeft () + 1 );}}
Var MyMar = setInterval (Marquee, speed)
Demo. mouseover (function () {clearInterval (MyMar);}) demo. mouseout (function () {MyMar = setInterval (Marquee, speed );})
</Script>
This seamless scrolling code. If a page is called multiple times, what should I change?
Function addEventSimple (obj, evt, fn ){
If (obj. addEventListener ){
Obj. addEventListener (evt, fn, false );
} Else if (obj. attachEvent ){
Obj. attachEvent ('on' + evt, fn );
}
}
AddEventSimple (window, 'load', initScrolling );
The code is initialized and the initScrolling function is actually executed.
The initScrolling function operates on scrollText nodes:
Function initScrolling (){
ScrollingBox = document. getElementById ("scrollText ");
// Style settings, which are basically irrelevant to scrolling. CSS settings should be used.
ScrollingBox. style. height = "250px ";
ScrollingBox. style. overflow = "hidden ";
// Scroll
ScrollingInterval = setInterval ("scrolling ()", 40 );
// Click the mouse to stop the scroll Effect
ScrollingBox. onmouseover = over;
// Scroll out with the cursor
ScrollingBox. onmouseout = out;
}
If you know the call relationship, how can you change it?
Seamless scrolling of Jquery text to the left-like Sina meager Unlogged-on home page is hot and rolling answers
It is nothing more than DOMAttrModified and DOMSubtreeModified.
Adjust the left value of ul's position in real time. The first li is completely hidden and then moved to the end of ul.