开发者

Having trouble setting size with nyroModal v2

I'm just now starting to work with nyroModal. After going nuts trying to figure out why the nyroModalSettings vanished (appears that was pre-v2... or so I gather), I got a little closer to making options work.

This, for instance, works fine for me:

<script type="text/javascript">
    $(function() {
        $('.nyroModal').nm({showCloseButton: false});
        });
</script>

My popups will come up with no close button, as expected.

Following that syntax, I thought this should work to bring up a smaller box than the default:

<开发者_JS百科;script type="text/javascript">
    $(function() {
        $('.nyroModal').nm({sizes: {w: 100, h: 100}});
        });
</script>

No go. No syntax errors, etc... just no impact on the box size whatsoever.

I tried using the initW and initH options as well.

Any idea what I'm missing?

Thanks! - Aaron


I worked around this trouble to open an iframe. I had to use this options to set up dimensions and fix them before iframe was shown. Anyway, this works fine for me:

var width = 800;
var height = 600;
$('.nyroModal').nyroModal({
  sizes: {
    initW: width, initH: height,
    minW: width, minH: height,
    w: width, h: height
  },
  callbacks: {
    beforeShowCont: function() { 
        width = $('.nyroModalCont').width();
        height = $('.nyroModalCont').height();
        $('.nyroModalCont iframe').css('width', width);
        $('.nyroModalCont iframe').css('height', height);
    }
  }
});

I hope this can help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜