I have two functions that caluclate and adjust the height and width of elements on screen.
panelHeight sets the height of target elements to the ava
This is the purpose of the JQuery Deferred...
var deferred = $.Deferred();
somethingAsync(function() {
// callback stuff here
// now tell the deferred task it's ok to proceed
deferred.resolve();
}
deferred.done(function() {
// your finalize code here
});
Edit
Since the resolve event needs to be tied to a dom resizing, maybe the Javascript resize event handler would work.