nyroModel不会自动resize
使用$.nmManual
而不是默认的.nyroModal
。 默认的nyroModel将根据浏览器窗口大小自动调整模型大小,但filter在尝试设置时最多是模糊的。
$('.nyroModal').nyroModal();
默认function正常。
$.nmManual('test.html', { modal: true, //doesn't seem to do anything sizes: { minW: 805, //this works minH: 610, }, showCloseButton: false, //also works anim: { resize: true, //both these do nothing showTrans:true, }
我的nyromodel网站很难准确理解resize
, def
和showtrans
实际使用的参数。
我有一些关于通过$.nmManual
在手动模式下使用插件的答案。 基本上你必须用这样的代码初始化filter:
$.nmManual('http://mypage.html/', { callbacks: { initFilters: function(nm) { nm.filters.push('somefilter'); nm.filters.push('anotherfilter'); } } });
要手动打开页面,只需要$.nmManual('mypage.html');
如果我没记错,它会加载link
filter,但如果你想在iframe中手动打开一个页面,你需要link
和iframe
filter: 在nyroModal中手动打开iframe?
关于加载页面的大小调整,很久以前我正在处理,但我没有结果…使用此代码:
$(window).resize(function() { if($.nmTop() !== undefined) { $.nmTop().resize(true); } });
我们可以强制resize,但在这种情况下它工作非常糟糕,有一个延迟步骤,因为你可以看到玩窗口…我没有时间重写resize
function…
我不知道使用DOM选择器这种行为是否相同。
最后,选项modal: true
可以防止在单击其边缘外部时关闭弹出窗口,即在深色背景中。