Reputation: 31
I'm using the jquery simplemodal plugin, but i'm not sure that with this plugin is possible open a simplemodal dialog from another simplemodal dialog. Someone knows is it possible?
Thanks,
Lucio
Upvotes: 3
Views: 3078
Reputation: 11
I have, recently, found out that, unfortunately, variables in javascript are, actually, global.
So, with that in mind, simply save the contents of the div and re-apply it back if necessary.
currentContent = $('#div').html(); ... ... ... ... ... $('#div').html(currentContent);
That works! I do it myself in one of my applications (websites).
Upvotes: 1
Reputation: 2841
SimpleModal only allows one modal open at a time. You can swap the content or close then re-open a new modal.
Here's an example of how to the latter: http://jsbin.com/aqavo3/
Click "Edit using JS Bin" to view the code.
Upvotes: 3