nyroModel does not auto resize

拟墨画扇 提交于 2019-12-05 03:23:01

问题


Using $.nmManual instead of the default .nyroModal . The default nyroModel will resize the model automatically based on the browser window size, but the filters are vague at best when trying to set this.

$('.nyroModal').nyroModal(); Default function works fine.

$.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,
                        }

I nyromodel site makes it quite hard to understand exactly what parameters the resize, def, and showtrans actually use.


回答1:


I have some answers about using the plugin in manual mode through $.nmManual. Basically you have to init filters with a code like this:

$.nmManual('http://mypage.html/', {
    callbacks: { 
      initFilters: function(nm) {
      nm.filters.push('somefilter');
      nm.filters.push('anotherfilter');
    }
  }
});

To open manually a page just you need $.nmManual('mypage.html'); if I remember right it will load the link filter, but if you want open manually a page inside an iframe you need both link and iframe filter: Open iframe manually in nyroModal?

About resizing of a loaded page, time ago I was dealing with but I have no results... using this code:

$(window).resize(function() {
    if($.nmTop() !== undefined)
    {
        $.nmTop().resize(true);
    }
});

we can force resizing but in this case it works very bad, with a delay step as you can see playing with the window... I had no more time to rewrite resize function...

I don't know if this behaviour is the same with using a DOM selector.

Finally the option modal: true prevents closing of the popup window when you click outside its edge, that is in the dark background.



来源:https://stackoverflow.com/questions/8263548/nyromodel-does-not-auto-resize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!