Jquery simple and practical seamless scrolling Effect

Source: Internet
Author: User

Jquery simple and practical seamless scrolling Effect

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.bKjia. c0m/1999/xhtml">
<Head>
<Title> simple and practical seamless rolling effect </title>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<! -- Add the following code between <Style type = "text/css tutorial">
* {Font-size: 12px ;}
# Mydiv ul {height: 180px; overflow: hidden; margin: 20px; background: # eee; width: 300px}
# Mydiv ul li {height: 25px; line-height: 25px ;}
</Style>
<Script src = "http://www.google.com/jsapi"> </script>
<Script language = "javascript tutorial">
Google. load ("jquery", "1.3.1 ");
Google. setOnLoadCallback (OnLoad );
Function OnLoad (){
Function giveInterval (funcName, time) {var args = []; for (var I = 2; I <arguments. length; I ++) {args. push (arguments [I]);} return window. setInterval (function () {funcName. apply (this, args) ;}, time );}
Function marquee (elem ){
If (! Elem. cloned ){
Elem.html(elem.html()+elem.html ());
Elem. cloned = 1;
Elem. Stop = "go ";
Elem. hover (function () {elem. Stop = "stop" ;}, function () {elem. Stop = "go "})
Elem. pause = 0;
}
Var scrtop = elem. attr ("scrollTop ");
If (elem. pause! = 0 ){
Elem. pause --;
Return;
}
If (scrtop) % 100 = 0 ){
Elem. pause = 100;
}
If (elem. Stop = "stop") return
Scrtop ++;
Elem. attr ("scrollTop", scrtop );
If (elem. attr ("scrollTop")> = elem. attr ("scrollHeight")/2 ){
Elem. attr ("scrollTop", 0 );
Scrtop = 0;
}
}
GiveInterval (marquee, 10, jQuery ("# mydiv ul "));
}
</Script>
</Head>
<Body>
An error is prompted in the lower left corner of the preview result, and the effect is invisible. Refresh the page to see the effect. Of course, this problem does not occur in actual use. <Br>
<! -- Add the following code to the <body> and </body> -->
<Div class = "marquee & step = 1 & delay = 10" id = "mydiv">
<Ul>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "WEB "href = "#"> start: www. bKjia. c0m </a> </li>
<Li> <a rel = "bookmark" title = "China WEB First stop" href = "#"> start: www. bKjia. c0m </a> </li> </ul>
</Div>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.