changing size of nyromodal window

柔情痞子 提交于 2019-12-05 05:47:34

问题


This script waits till user presses the button so nyromdal starts

$('.image_upload').nm({
    sizes: {minW:10,minH:10 },
    modal: false,
  closeOnClick: false
        });

Then in after press script, after changing content of nyromodal window I'm trying to change the size of window but it does not changes it immediately so the size remains old, scroll bars appear. And new size affect window only if you close the window and call it back again.

This code puts new content into nyromdal window

$('.nyroModalDom').html(responseimage);

And here we have 2 ways of changing the size. Both work only after close-reopen of window, not immediately.

1

$.nyroModalSettings({
width: 800,
height: 800
});

2

$.nmObj({
width: 800,
height: 800
});

So how can I change the size of window without reopen ?

UPDATE

Have found just now new function but it also fails to resize the window. Scroll bars disappear as if window wants to resize but it remains the same and scroll bars appear again.

$('.nyroModalDom').resize();

回答1:


You can try to use this instruction:

$.nmTop().resize(true);

that is, in my experience, the right way to performe the resizing.

UPDATE

You can adjust the height using the callback afterResize adding code like this:

$('.image_upload').nm({
    callbacks: {
        afterResize: function(nm) {                
           // to adjust according to your needs                
           $('nyroModalCont').css('height', $('.nyroModalDom img').height());
        }
    }
});


来源:https://stackoverflow.com/questions/8135971/changing-size-of-nyromodal-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!