jQuery fadeIn()具有多个div的不同间隔

问题描述:

我有一个包含六个div的主页.它们是不同形状的盒子,我希望它们在页面加载时以随机的间隔淡入. javascript代码如下:

I have a homepage with six div's. They are different shaped boxes, and I want them to fade in at random intervals when the page loads. The javascript code is as follows:

$(document).ready(function(){
    $("#topleft").fadeIn(2000).animate({opacity: 1.0});
});

当然,我需要将所有六个div作为目标,而不仅仅是一个,并且我希望它们在页面加载后约3秒钟内随机消失.我将如何处理?顺便说一下,由于我是jQuery的新手,所以我可能会使用一些我不知道的东西.

Of course, I need all six div's to be targeted, not just one, and I want them to randomly fade in within about 3 seconds of the page load. How would I go about this? By the way, I am using jQuery and since I'm new at it, there may be something I could use that I don't know about.

以下是您的示例: http://jsfiddle.net/Paulpro/gTFsk/