has the following code:
- 1st li element
- 2nd li element li>
- The 3rd li element
- The 4th li element
- The 5th li element< /li>
- The 6th li element
- The 7th li element
- The 8th li element< ;/li>
However, the page only displays the first 5 li (the relevant css will not be described in detail). If you want to display the content in the li in a loop, you need to move the ul upward by the height of the li at the specified time, and at the same time add the first li to The end of li in ul.
The code is 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)
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn