Create an endless loop in Jquery

后端 未结 6 1438

The HTML structure is like this

  • some Text
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 09:57

    DEMO

    var el = $('.innerfade li'),
        i = 0;
    $(el[0]).show();
    
    (function loop() {
        el.delay(1000).fadeOut(300).eq(++i%el.length).fadeIn(500, loop);
    }());
    

提交回复
热议问题