我试图用jQuery一次一个地淡化每个HTML5元素

时间:2015-02-12 22:34:29

标签: javascript jquery html5

为什么不起作用?

$eachmultiplechoice = $('.eachmultiplechoice');

$eachmultiplechoice.each(   function(index) 
{   $(this).delay(200*index).fadeIn(300);   }   ); 

http://jsfiddle.net/pppun97y/

1 个答案:

答案 0 :(得分:0)

因为元素没有隐藏。因为它们是可见的fadeIn没有做任何事情。隐藏它们然后工作

$eachmultiplechoice.hide().each(function(index) {
    $(this).delay(200 * index).fadeIn(300);
});