fancybox - 如何滚动fancybox模态而不是页面

时间:2013-12-11 05:52:26

标签: jquery scroll fancybox

我的fancybox模式的高度超过了页面的高度。我知道我可以在模态中添加一个滚动条,但这不是我要找的解决方案。是否可以使用页面滚动条滚动模态,以便我可以看到模态的隐藏部分?

1 个答案:

答案 0 :(得分:0)

您的目标内容包含维度(widthheight),或者您将widthheight设置为fancybox API选项。

无论如何,请将fitToView设为false

A)。内容尺寸

$(".fancybox").fancybox({
    fitToView: false
});

B)。在fancybox中设置尺寸

$(".fancybox").fancybox({
    fitToView: false,
    width: 350, // or whatever
    height: 1000 // height longer than the viewport
});

参见 JSFIDDLE