javascript - Jquery fadeOut one by one -
i tried give item_div
inside container_div
fadeout
1 one. , tried code , fadeout
together, can improve or suggestion can that?
$(".container_div .item_div").each(function(idx){ $(this).delay(100*idx).fadeout(3000); });
.container_div{ background:#ccc; } .item_div{ background:#454545; color:#fff; margin:5px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <div class="container_div"> <div class="item_div">1</div> <div class="item_div">2</div> <div class="item_div">3</div> </div>
try this
$(".container_div .item_div").each(function(idx,item){ settimeout(function(){ $(item).fadeout(1000); }, (idx+1)*1000); });
this works fine here fiddle
Comments
Post a Comment