Question

I have a problem with the Simple Modal (Eric Martin) modal window.

I have a window that needs a scrollbar. I have found the having autoResize set to true correctly sets the scrollbars when the browser window is shrunk down.

However if I then resize the browser window large again, the modal window stays at the shrunk size.

If I have autoResize turned off and include the following code

$(window).resize(function() {
$("#simplemodal-container").css("height","auto");
 $(window).trigger('resize.simplemodal');  
});

then the resize works correctly. However I need autoResize to be turned on in order to get the scrollbars to appear when the browser window is shrunk down.

Any help would be very much appreciated.

Thanks,

Était-ce utile?

La solution

Ok, I have managed to answer my own question. If I define the modal window with the minHeight property set then the modal window will naturally expand back to the correct size when the browser window is re-expanded.

Doing this I don't even need the resize function mentioned above.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top