<script type = "text/javascript">
function scroll_news(){
    var firstNode = $('#scroll-container li'); //获取li对象
    firstNode.eq(0).fadeOut('slow',function(){ //获取li的第一个,执行fadeOut,并且call - function.
     $(this).clone().appendTo($(this).parent()).show('slow'); //把每次的li的第一个 克隆,然后添加到父节点 对象。
     $(this).remove();//最后  把每次的li的第一个 去掉。
  });//注意哦,这些都是在fadeOut里面的callback函数理执行的。
}
setInterval('scroll_news()',500);//每隔0.5秒,执行scroll_news()
</script>

 

body:

jQuery新闻循环滚动. 程序代码
<div >
  <li>1111111111111111111</li>
  <li>2222222222222222222</li>
  <li>333333333333333333333</li>
  <li>44444444444444 </li>
  <li>55555555555555555555555</li>
</div>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-07-07
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
相关资源
相似解决方案