I need to delay exit from js method. Normally I am using callbacks,
but I am working with some designers who do not really grasp the
concept.
So I started to think about a way to ease work for them but I am not
sure it is possible at all...

var test = 0;
var trigger= function(){ test = 1; };
trigger.delay(5000);

var main = function(){
    while(test==0){
        sleep(200);
    }
    return "TEST";
}

alert('start');
if(main()=='TEST'){
    alert('end');
}

Is in mootools anything like sleep which would work in similar
context? Maybe some smart trick with delay or periodical?


Thanks,
Robert

Reply via email to