Fancybox v2 No Hide on Overlay Click - How?

浪尽此生 提交于 2020-01-06 16:24:20

问题


Recently upgraded to Fancybox v2 and can't figure out how to keep Fancybox open when someone clicks outside of the DIV.

I tried "Overlay: null" but then the user can click around the site and navigate away..

I know in Fancybox v1 it was HideonOverlay Click... Any suggestions?


回答1:


Try the following.

helpers : { 
  overlay : {closeClick: false}
}



回答2:


Here is a piece of code and is self explanatory, hope you will find it useful:

$('#locator').live('click', function(){
    $.fancybox({
        type: 'iframe',
        hideOnOverlayClick: false,
        scrolling: 'no',
        autoSize: true,
        href: site_url + 'home/locator',
        beforeClose: function (){
        var latlng = $(".fancybox-iframe").contents().find('input[name=latlng]').val();
            $('input[name=location]').val(latlng);
        }
    });
});

I bumped into this question while searching something and felt I would answer it.



来源:https://stackoverflow.com/questions/8621225/fancybox-v2-no-hide-on-overlay-click-how

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