Your Ad Here

2 January 2013

jQuery tools overlay with queue integration

Few days back I had one problem that is related to standard jquery .overlay() method and multiple messages on the page.

Say you have two different messages that you want to display in an overlay, and call multiple methods during page load (sometimes it's hard to tell how many messages you will get as they can depend on site mode, user status and etc.). Once you will call $(...).overlay() it will try to open both messages and can break background (it just dissapears) can show messages that will overlap each other and that sucks! No matter what is behind the page and how fast it works if UI sucks...

To avoid this I simple extension for standard $.overlay() method that will just enqueue messages and will show them in order you loaded.




Download Now
 

It also has a support to display how many messages are in the queue right now, to use it bind this event to body:

$("body").bind("overlayCount", function(event, count)
{

   ...
}

You can use it for tips on your web page and show multiple images for user as a guide on how to do something.
 It won't affect initial .overlay behavior, so enyoj!