I would for every loop an other random number, but it does not want worke... I don't know why.
$(document).ready(function(){
setTimeout("execute()",5000);
})
function execute(){
for(i=0;i<5;i++){
var zWindow = $(window).height();
var yWindow = $(window).width();
var z=Math.floor((Math.random() * zWindow) + 1);
var y=Math.floor((Math.random() * yWindow) + 1);
$("#egg").css({
"top": z,
"left": y
});
$("#egg").delay(1000).fadeIn(10).delay(3000).fadeOut(100);
}
}
Aucun commentaire:
Enregistrer un commentaire