javascript - 如何改变 fancybox 的宽度?

标签 javascript html fancybox

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

$.fancybox.open(attemp2.map(function (el) {
    return {
        src: el,
        opts: {
            caption: tempName,
        }
    };
}), {
    loop: false,
    toolbar: true
});

最佳答案

这是我自己使用 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
});

关于javascript - 如何改变 fancybox 的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47921539/

相关文章:

javascript - js中有没有空格的方法?

javascript - 如何从 AJAX 响应中选择变量

javascript - 通过jquery获取包含相同类的不同隐藏值

javascript - 在jsp中更新数据列表

javascript - 单击链接两次以激活 ui router 的状态

javascript - 使用 Javascript 中的 Google Drive API 批量插入权限 API

html - 右侧对齐无 float

javascript - 如何使用 css 制作自动调整水平线 DIV 大小?

jquery - Fancybox 的完整图像尺寸

jquery - Fancybox 2 不会加载谷歌地图?