简体   繁体   English

如何更改花式框的宽度?

[英]How to change fancybox width?

I have a gallery width 1920 width and long height, but fancybox show my images with fit width and height to the screen, I want to fit my image to screen width with height scrolling, here is my codes: 我的画廊宽度为1920宽度,高度为长,但是fancybox将我的图像的宽度和高度设置为适合屏幕的大小,我想通过高度滚动将图像的大小调整为适合屏幕宽度的代码,这是我的代码:

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

Here a little code snippet from my own usage of fancybox. 这里是我自己使用fancybox的一些代码片段。 I adjusted width and height by percentage. 我按百分比调整了宽度和高度。

$(".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
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM