我有一个包含索引类的列表 - 在容器 div 淡入时一次显示这些类的最佳方式是什么?
Give them a common class, and do the fadeIn()[docs] in a loop using the each()[docs] method while delaying each one with the delay()[docs] method for a given duration multiplied by the index of the loop.
$('li.someClass').hide().each(function( i ) {
$(this).delay( i * 400 ).fadeIn();
});
每个元素将比前一个元素晚 400 毫秒开始。
Example: http://jsfiddle.net/4ANCj/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)