最终效果图
源代码:
function scroll_news(){
var $firstNode = $('#scroll-container li');
//得到 i的值 列数
var iRow = $('#scroll-container').find('li').length – 1;
//debugger;
$(function(){
$firstNode.eq(0).fadeOut('slow',function(){
$(this).clone().appendTo($(this).parent()).fadeIn('slow');
$(this).remove();
$firstNode.eq(iRow).hide();
});
});
}
$(document).ready(function(){
go();
});
function stop(){
clearInterval(sn);
}
function go(){
sn = setInterval('scroll_news()',2000);
}
#scroll-container{border:1px #000 solid;background:#FEC;height:23px;line-height:23px;}
#scroll-container li{list-style:none;display:none;font-size:12px;}
li a{color:#F00;text-decoration:none;margin-left:10px;}
li a:hover{text-decoration:underline;}