开发者

Jquery/Javascript Animation

开发者 https://www.devze.com 2023-01-09 08:03 出处:网络
How would I go about making divs appear and disappear in sequential order?My plan is to have a 6 different divs: 1-6 appear in sequential orde开发者_Go百科r.Then after a couple of seconds, they will d

How would I go about making divs appear and disappear in sequential order? My plan is to have a 6 different divs: 1-6 appear in sequential orde开发者_Go百科r. Then after a couple of seconds, they will disappear (6-1) and reappear in sequential order again.


I think that should do the trick:

for(var i=0;i<6;i++)
  $('#div'+i).delay(i*500).fadeIn().delay(4000-i*500).fadeOut();

.delay() was introduced in jQuery 1.4.

0

精彩评论

暂无评论...
验证码 换一张
取 消