改变nyromodal窗口的大小 [英] changing size of nyromodal window

查看:127
本文介绍了改变nyromodal窗口的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此脚本等待用户按下按钮以启动nyromdal

This script waits till user presses the button so nyromdal starts

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

然后在按下脚本后,更改了nyromodal窗口的内容后我正试图改变大小窗口,但它不会立即更改它,因此大小保持旧,滚动条出现。只有当你关闭窗口并再次调用它时,新大小会影响窗口。

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.

此代码将新内容放入nyromdal窗口

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 ?

更新

刚刚找到新功能但它也无法调整窗口大小。滚动条消失,就像窗口想要调整大小但它保持不变并再次出现滚动条。

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();


推荐答案

您可以尝试使用此指令:

You can try to use this instruction:

$.nmTop().resize(true);

根据我的经验,这是执行调整大小的正确方法。

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

UPDATE

您可以使用回调调整高度afterResize添加如下代码:

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());
        }
    }
});

这篇关于改变nyromodal窗口的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆