In my application, I am trying to hide scrollbars in the parent window when a modal dialog is opened...
I've added this to my Master Page:
$(function(){
if(window.frameElement != null)
{
window.top.$("body").css("overflow","hidden");
}
});
This does successfully hide the scrollbars when the modal dialog is opened, however I have been unable to set them back to "auto" when the dialog is closed.
Naturally, I tried window.unload, but clicking the "X" or the "Close" button do not fire window.unload... What event can I capture to reset body overflow here? I am looking for a universal way to achieve this, without specifically setting click events for buttons, since there are a number of ways to close a dialog.
Thanks!