Jquery setInterval() not working

前端 未结 5 2043
野性不改
野性不改 2020-12-20 16:30

I\'m trying to create a kind of slideshow.

The problem:

function slides(x) {
      $(\"#irack\").stop().animate({\"left\": x}, 20);
 };
setInterval         


        
5条回答
  •  有刺的猬
    2020-12-20 17:03

    In you call to setInterval the slides method is being called inline change the call to as below:

    setInterval(function(){slides(-30);},300);
    

提交回复
热议问题