Fancybox 2 -- 停止在画廊中调整大小

4

我正在尝试让Fancybox停止调整图库中的图片大小。我有一些较大的图片需要滚动。这是我的当前fancybox jQuery代码:

$('.gallery').fancybox({
            padding: 0,
            scrolling: 'yes',

            openEffect : 'elastic',
            openSpeed  : 150,

            prevEffect : 'fade',
            nextEffect : 'none',
            closeEffect : 'elastic',
            closeSpeed : 100,

            closeBtn  : false,
            arrows    : true,
            nextClick : true,

            helpers : { 
                thumbs : {
                    width  : 50,
                    height : 50
                },
                overlay : {
                    opacity : 0.8
                }
            }
        });
2个回答

4

fitToView设置为false即可实现以下目的:

$('.gallery').fancybox({

            fitToView: false, // add this

            padding: 0,
            scrolling: 'yes',

            openEffect : 'elastic',
            openSpeed  : 150,

            prevEffect : 'fade',
            nextEffect : 'none',
            closeEffect : 'elastic',
            closeSpeed : 100,

            closeBtn  : false,
            arrows    : true,
            nextClick : true,

            helpers : { 
                thumbs : {
                    width  : 50,
                    height : 50
                },
                overlay : {
                    opacity : 0.8
                }
            }
        });

很可能您忘记了在此选项与下一个选项之间添加试用逗号,或者您将 false 布尔值用引号括起来,或者其他语法问题引发了 js 错误。 - JFK

0

autoScale属性对我很有效。

$('.gallery').fancybox({
    'autoScale':false,
});

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接