Search code examples
javascriptjqueryresizenyromodal

How to resize nyroModal once content height/width has been changed


I am using nyroModal to show a modal window. It works fine when the initial content is showed. But in the content I have a jQuery toggle method, that makes visible other sections.

I want the modal to auto resize to the new content area. How can I implement that.


Solution

  • I haven't tried this, but nyroModal listens for window resize events to resize the modal, so maybe triggering one yourself could help here. E.g.

    $(window).resize();
    

    However if the "modal window" is an iframe, then nyroModal won't know what size to resize the modal to.