23 lines
592 B
JavaScript
23 lines
592 B
JavaScript
|
export function autoani(){
|
||
|
$(".factoryInfo>li:first-child").animate(
|
||
|
{
|
||
|
"margin-top":'-30px'
|
||
|
},
|
||
|
2000,
|
||
|
function(){
|
||
|
$(this).css("marginTop","0");
|
||
|
$(".factoryInfo").children("li").eq(0).remove();
|
||
|
$(".factoryInfo").append(this);
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
|
||
|
//自动间隔时间向上滑动
|
||
|
var anifun = setInterval(autoani,1000);
|
||
|
//悬停时停止滑动,离开时继续执行
|
||
|
$(".factoryInfo").hover(function(){
|
||
|
clearInterval(anifun); //清除自动滑动动画
|
||
|
},function(){
|
||
|
anifun = setInterval(autoani,1000); //继续执行动画
|
||
|
})
|