Jquery Fancybox高度/向下滚动

Jquery Fancybox height / scroll down

本文关键字:滚动 Fancybox 高度 Jquery      更新时间:2023-09-26

我使用fancybox在我的网站上显示某些页面。我的问题是,我不知道如何使它具有固定的高度,并在必要时向下滚动以查看更多内容(如果内容向下流动超过风扇盒的特定高度参数)

这是我在页面中的参数:

<script>
$(document).ready(function() {
    $(".fancybox_link").fancybox({
    'width'             : 680,
    'height'            : 550,
    'autoScale'         : false,
    'autoDimensions'    : false,
    'scrolling'         : 'no',
    'transitionIn'      : 'none',
    'transitionOut'     : 'none',
    'type'              : 'iframe'
    });
});
</script>

我应该怎么做才能让内容通过高度滚动条流动?非常感谢。

编辑:是"Scrolling:'yes'"参数不起作用吗?

否则,我认为,你可以编辑/覆盖Fancybox CSS:

#fancybox-content {
    height: 680px;
    width: 550px;
    padding: 0;
    margin: 0;
    overflow: scroll;
}

或者类似的东西。我在以前的一个项目中已经这样做了,但手头没有代码来提供确切的语法。

您实际上需要设置选项

'scrolling' : 'yes',

这将在fancybox中创建滚动条,以便您可以浏览长内容。

尝试使用:

"autoSize":错误