I'm trying to use the NyroModal jQuery plugin with the following code:
$('img').click(function(e) {
e.preventDefault();
$.nmManual('pages/'+$(this).attr('id')+'.html', {
sizes: {
w: 1450,
h: 800,
initW: 2,
initH: 1
开发者_JS百科 },
resizable: false,
closeOnEscape: false
});
});
For some reason, the resizable and closeOnEscape work, but the sizes don't.
try this:
$.nmManual('http://jsfiddle.net/', { callbacks : { initFilters : function (nm) { nm.filters.push('link'); nm.filters.push('iframe'); }, size:function(nm){ nm.sizes.h = 550; nm.sizes.w = 550; } } });
This is weird because there's resizable
option.
I tried using the sizes and it works: http://jsfiddle.net/LekisS/hBxJn/2/
For anyone stumbling upon this Question: To set the size of the nyroModal window you have to use:
sizes: {
minW: width,
minH: height
}
The other size parameters are all overwritten during the content load.
For an IFrame link the IFrame window size can only be changed in the nyroModal.css file :(
You can do that with jQuery:
$('.nyroModalCont,iframe').css('width', width + 'px');
$('.nyroModalCont,iframe').css('height', height + 'px');
Normally you should set both size options (nyroModal window + IFrame) for an IFrame to avoid double scrollbars...
精彩评论