jQuery SimpleModal Popup: How to open second popup on first popup close event?
How to open second popup on first popup close event?
If I'm opening second modal popup on first modal popup event -
$divFirstPopup.modal({
onClose: function(dialog) {
$.modal.close();
$.modal('#divSecondPopup');
}
});
But second popup does not appear. Can anyone provide help on this?
I think it is because:
$.modal('selector');
does not work only this should work:
$.modal($('selector'));
For this you have to open the second popup after closing the first one which takes around 2 sec. So, if you use settimeout() function and call the second pop by providing 2sec delay or greater than this. It will work. Since, this is not a proper way to do so. But it actually works for me.
I am using Simple modal jquery plugin: Here is the code:
$('#forgot_password_modal').click(function (e) {
$.modal.close(); // this is written to close all the popups.
setTimeout(function(){
$('#forgot_password_form').modal({ //to open a second popup
minHeight:570,
minWidth:600,
maxWidth:671,
opacity: 90,
onOpen: function(dialog) {
dialog.overlay.fadeIn('slow', function() {
dialog.data.hide();
dialog.container.fadeIn('slow', function() {
dialog.data.slideDown('slow');
});
});
},
onClose: function(dialog) {
dialog.data.fadeOut('slow', function() {
dialog.container.slideUp('slow', function() {
dialog.overlay.fadeOut('slow', function() {
$.modal.close(); // must call this!
});
});
});
}});
}, 2000);
return false;
});
精彩评论