what I am trying to do is the following:
- Close the current open modal
- Open a new modal
This is proving annoyingly complicated (might be because I am not that much into jQuery and AJAX). I have a login modal and a register modal and currently when you click login you have an option to click “create account” which opens up a new modal. This all works fine but if you close the second modal (the create account one) it closes both modals (login and register) BUT it keeps a tinted and unclickale background as thought it only closed one of them. Is there a way to close the login modal first and then the register? I tried with $.modal.close() but that didn’t seem to work. The way I did it was this:
$(".registerBtnClick").bind('click', function(){
$.modal.close();
$("#registerModal").bPopup({
modalColor: ('#333'),
opacity: (.9),
closeClass: ('close')
});
return false
});
Any ideas? (Would be nice if you could be very specific as I, like I said, am not super great with jQuery.
It may be the setTimeout in the current close function that is causing the issue. Try the following:
http://jsbin.com/aqavo3/edit