本文介绍了悬停时如何使旋转列表停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.min.js">
</script>
<script>
var test = function(){
    if(keepGoing){
        var pre = $("ul li:first-child"); 
        pre.each(function(i){ 
            $(this).slideUp(function(){
                $(this).appendTo(this.parentNode).slideDown();
            });
        });
    }
}

var keepGoing = true;

window.setInterval(test, 3000);

$("ul").hover(function(){
    keepGoing = false;
}, function(){
    keepGoing = true;
});
</script>

</head>
<body><ul> 
      <li>list 1</li> 
      <li>list 2</li>
      <li>list 3</li>
      <li>list 4</li>
   </ul></body></html>


我只想停下来将列表停下来旋转.谁能告诉我我要去哪里哪里.


I just want to stop list to rotate when hovered . Can anybody tell me where i am going wrong .

推荐答案




这篇关于悬停时如何使旋转列表停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 22:54