Question

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
                        },
                        resizable: false,
                        closeOnEscape: false
                    });
                });

For some reason, the resizable and closeOnEscape work, but the sizes don't.

Was it helpful?

Solution

This is weird because there's resizable option.

I tried using the sizes and it works: http://jsfiddle.net/LekisS/hBxJn/2/

OTHER TIPS

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

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...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top