我有一个宽度为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/