ランダムに選択されたすべてのdivをフェードアウトするスクリプトを実行しようとしています。
それはいつも最後にカップルを座ったままにしておくようです。
JS
function hideCube() {
$('#group').show('slow');
$('.pxl').each(function(index, element) {
var sleepTime = Math.floor(Math.random() * 5000);
var t = setTimeout(function() {
var d = Math.floor(Math.random() * 5000);
$(element).fadeTo(d, 0);
}, sleepTime);
});
}
$(function() {
$('.pxl').each(function(index, element) {
var sleepTime = Math.floor(Math.random() * 5000);
var t = setTimeout(function() {
var d = Math.floor(Math.random() * 1000);
$(element).fadeTo(d, 0.99);
}, sleepTime);
});
var h = setTimeout(hideCube, 3000);
});