How to resize nyroModal once content height/width has been changed
-
10-10-2019 - |
Question
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.
OTHER TIPS
Run this javascript:
$.nyroModalSettings({
width: 645,
height: 410,
windowResizing: true
});
And your nyroModal
will be resized (animated)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow