Question


I created a simple jQuery script, that's displays notification for users. This script is available on: jsfiddle.net/vLqQF/
I want to create queue, if I run 5 notice in short time, users dosnt see them. It's only working if prev is complete and hidden. I'm trying do a simple queue for that, but it seems to be more complicated. Anybody could help me?

Was it helpful?

Solution

Take a look at setInterval(). You can call your action and specify a time to wait:

var interval = setInterval(function(){
    notice(1,1,'Hello World2');
}, 2000);

Then to clear the interval just use

clearInterval(interval);

This will clear the interval when you click the div

Updated your fiddle:

http://jsfiddle.net/vLqQF/4/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top