Fancybox - Image is overflowing off right side of lightbox

后端 未结 4 933
太阳男子
太阳男子 2021-01-06 15:25

Looks like this question has been asked before, here, but the asker solved his own question by switching to prettyPhoto. I\'d prefer to figure out why this is happening, jus

4条回答
  •  走了就别回头了
    2021-01-06 15:55

    fix body margin right for FancyBox 2 and Bootstrap 3

        $(function(){   
        $("a.zoom").fancybox({
            beforeShow  : function() {
                document.onmousewheel=document.onwheel=function(){ 
                    return false;
                };
                document.addEventListener("MozMousePixelScroll",function(){return false},false);
                document.onkeydown=function(e) {
                    if (e.keyCode>=33&&e.keyCode<=40) return false;
                }
            },
            afterClose  : function(){
                document.onmousewheel=document.onwheel=function(){ 
                    return true;
                };
                document.addEventListener("MozMousePixelScroll",function(){return true},true);
                document.onkeydown=function(e) {
                    if (e.keyCode>=33&&e.keyCode<=40) return true;
                }
            },      
            prevEffect  : 'none',   // this is not important 
            nextEffect  : 'none',   // this is not important 
            helpers : {
                title   : {
                    type: 'over'    // this is not important
                },
                thumbs  : {
                    width   : 80,   // this is not important 
                    height  : 80    // this is not important 
                },
                overlay : {
                    locked : false  // !this is important!
                }           
            }
        });
    });
    

提交回复
热议问题