Hello,
I don't understand why this code doesn't work :
function Messages(type,text) {
console.log("In function Message");
$("#message").clearQueue();
console.log("clearQueue :"+$("#message").queue("fx").length+" effet in queue");
if($("#message").length > 0 && $("#message").not(":visible").length == 1) {
$("#message").slideDown("slow");
}
$("#message").queue(function(){
$(this).delay(5000).fadeOut("slow");
$(this).dequeue();
});
console.log("Adding "+$("#message").queue("fx").length+" effet in queue");
}
And this is the console log :
In function Message
1346clearQueue :0 effet in queue
1356Adding 2 effet in queue
But it seems like clearQueue doesn't work because i have this :
Message appears, he disappears 5 second after..
Message appears, after 4 seconds, I call "Message" again, and #Message disappears after one seconds.
So, if Message is called more than one time, the delay dosn"t change and #Message disapears allways 5 seconds after the first call..
Could you help me ?
(Sorry for basic english, i'm trying to do the best as i can )