$(function () {
//获得当前
var $ulist = $(".bm-r-people ul");
var timer = null;
//触摸清空定时器
$ulist.hover(function () {
clearinterval(timer);
},function () {//离开启动定时器
timer = setinterval(function () {
scrolllist($ulist);
},1000);
}).trigger("mouseleave"); //自动触发触摸事件
//滚动动画
function scrolllist(obj) {
//获得当前- 的高度
var scrollheight = $("ul li:first").innerheight();
//滚动出一个
- 的高度
$ulist.stop().animate({margintop:-scrollheight},600,function () {
//动画结束后,将当前
margintop置为初始值0状态,再将第一个- 拼接到末尾。
$ulist.css({margintop:0}).find("li:first").appendto($ulist);
});
}
});