Chr*_*ris 5 jquery scroll list
我的javascript目前还没有达到标准,我很难过!
我需要用这样的javascript创建一个动画列表 - http://www.fiveminuteargument.com/blog/scrolling-list.
我想要的是采取这样的清单
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
并同时显示两个,然后一个循环显示它们,一次显示两个.
即使伪代码也会帮助我开始.
使用消息中包含的 html,您可以运行以下命令。
$(document).ready(function(){
//hide all the list items
$("ul li").hide();
//call the function initially
show_list_item();
});
function show_list_item(){
//fade in the first hidden item. When done, run the following function
$("ul li:hidden").first().fadeIn("slow", function(){
//if there are no more hidden list items (all were shown), hide them all
if($("ul li:hidden").length == 0){
$("ul li").hide();
}
//call this function again - this will run in a continuous loop
show_list_item();
});
}
Run Code Online (Sandbox Code Playgroud)