I have a page that uses a lot of javascript calculations when the page loads. This can lock the page up for a few minutes depending on how many calculations are performed.
I can open a jquery modal box on page load. The calculation functions then fire and then then once they are finished they modal box should close.
The problem the box is closing almost immediately after it is shown. The code I am using is here:
// In page startup functions
$(document).ready(function() {
// Initialise Modal
$('#dialog').jqm({ modal: true });
// Show Modal box
$('#dialog').jqmShow();
// Call all the startup functions and then hide the modal box
// once they have all completed.
StartUpCall((function() { $('#dialog').jqmHide(); })())
});
Is there an event that jQuery fires once all javascript has been completed? That would be first prize for me.
Edit: I am using jqModal - http://dev.iceburg.net/jquery/jqModal/