如何更改fancybox宽度?

问题描述 投票:0回答:1

我有一个画廊宽度1920宽度和长度,但fancybox显示我的图像与屏幕的适合宽度和高度,我想让我的图像适合屏幕宽度与高度滚动,这是我的代码:

$.fancybox.open(attemp2.map(function (el) {
    return {
        src: el,
        opts: {
            caption: tempName,
        }
    };
}), {
    loop: false,
    toolbar: true
});
javascript html fancybox
1个回答
1
投票

这是我自己使用fancybox的一小段代码片段。我按百分比调整了宽度和高度。

$(".imagebox").fancybox({
    maxWidth    : 600,
    maxHeight   : 600,
    wrapCSS     : 'fancy-imagebox', // add a class selector to the fancybox wrap
    margin      : [0, 0, 0, 0],
    width       : '70%',
    height      : '90%',
    autoSize    : true
});
© www.soinside.com 2019 - 2024. All rights reserved.