jquery
2010-11-23 4 views 1 likes 
1

Mon code jquery est cecomment arrêter événement timer jquery

var job=909; 
var id=0; 
var x=0; 
var maxx=50; 
$(document).everyTime(4000,function(x){ 

    var div= "#ttt_"+x; 
    $(div).hide().load('http://localhost/feed_001.php?job='+job+'&id='+id); 
    var tlHeight = 60; 
    $(div).animate({height: tlHeight},750).fadeIn(2500); 
    x = x + 1; 
    if (x == maxx){ 


     Type here 


    } 
    },0); 

Et je veux quand la condition x == Maxx satisfait l'événement à chaque fois que vous événement stop

Répondre

1

Ajouter un nouveau second argument connu sous le nom label puis utilisez stopTime ([label_name])

Par exemple:

$(document).everyTime(4000, 'feed_timer', function (x) { 
    ... 
    if (x == maxx) 
    { 
     stopTime('feed_timer'); 
    } 
},0); 
Questions connexes