Hey, j'ai ce morceau de jQuery/Javascript:jQuery .cliquez() ne fonctionne pas avec setInterval
$(document).ready(function() {
var points = 0;
var iterations = 10;
var winWidth = $(window).width();
var winHeight = $(window).height();
setInterval(function() {
if (iterations > 0) {
var rndX = Math.ceil(Math.random() * winWidth);
var rndY = Math.ceil(Math.random() * winHeight);
$('div.item').remove();
$('body').append('<div class="item" style="left: '+rndX+'px; top: '+rndY+'px;"></div>');
iterations--;
} else {
location.href = "http://www.google.com/";
$('*').remove();
}
}, 1750);
$('div.item').click(function() {
$(this).remove();
points = points + 1;
$('#points').val(points);
return false;
});
});
Mais pour une raison quelconque, le $('div.item').click(function()
ne se déclenche pas :(
Toutes les idées ?
Impressionnant, ty - va "cocher" quand SO me le permet. –
Finalement accepté! - Mieux vaut tard que jamais hein? –
A travaillé pour moi, merci !!! – normalUser