jquery implements the instance code that scrolls from bottom to top _jquery

Source: Internet
Author: User

Have the following code:

Copy Code code as follows:

<div id= "Odiv" >
<ul id= "Oul" >
<li> 1th li Element </li>
<li> 2nd li Element </li>
<li> 3rd li Element </li>
<li> 4th li Element </li>
<li> 5th li Element </li>
<li> 6th li Element </li>
<li> 7th Li Element </li>
<li> 8th li Element </li>
</ul>
</div>

But the page only shows the first 5 Li (related CSS do not repeat), want to loop show Li inside the content is in the enactment of the time will be the UL move up Li's height, at the same time will be the first Li added to the UL in the end of Li.
The code is as follows:

Copy Code code as follows:

function AutoScroll (obj, ul_bz) {
$ (obj). Find (UL_BZ). Animate ({
MarginTop: " -25px"
},500,function () {
$ (this). CSS ({margintop: "0px"}). Find ("Li:first"). Appendto (this);
});
}
SetInterval (' AutoScroll ("#oDiv", "#oUl") ', 3000

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.