jQuery plugin to manage little dialog boxes that can be stacked in the browser window.
Requires jQuery and jQuery UI.
It exposes 2 functions:
addStackedDialog(msg, opts)
- displays a new stackeddialog, removing the oldest to make room if requiredrefreshStackedDialogs()
- can be used in window resize handlers
var count = 1;
var opts = {
maxNum : 6,
autoCloseTimeout: 10000,
width: 300
};
$("#clickme").click(function() {
$.fn.addStackedDialog(count++ + ") Your changes have been saved!!!", opts);
});
var resizeTimer = null;
var windowHeight = $(window).height();
function handleResize() {
if (resizeTimer) clearTimeout(resizeTimer);
if (windowHeight != $(window).height()) {
resizeTimer = setTimeout($.fn.refreshStackedDialogs, 100);
}
}
$(window).bind('resize', handleResize);