jeudi 25 décembre 2014

How can I make the animations be run one by one?

The HTML code:



<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
</ul>


The js code:



<script type="text/javascript">
$(document).ready(function() {
var lis = $("li");
for (var i = 0; i < lis.length; i++) {
$(lis[i]).animate({opacity: 0}, 1000);
}
});
</script>


I just find that the lis will disappear together. How can I do that they will disappear one by one?





Aucun commentaire:

Enregistrer un commentaire