Create an endless loop in Jquery

后端 未结 6 1455

The HTML structure is like this

  • some Text
6条回答
  •  执念已碎
    2021-01-03 10:00

    Although not fit with your Endless Loopm but this is a Loop where you stop at the Endpoint

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

提交回复
热议问题