javascript Jquery Fancybox 高度/向下滚动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10030641/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 08:30:36  来源:igfitidea点击:

Jquery Fancybox height / scroll down

javascriptjqueryfancybox

提问by dana

i am using fancybox for displaying certain pages on my website. my problem is that i have no idea how i can make it with a fixed height and to scroll down to view more content if necessary (if the content flows down more than the specific height parameter of the fancybox)

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

here are my parameters in the page:

这是我在页面中的参数:

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

what should i do to make the content flow with a scroll bar for the height? thank you.

我应该怎么做才能使内容流动与高度的滚动条?谢谢。

采纳答案by Akarun

Edit :Is it the "Scrolling : 'yes'" parameter that doesn't work ?

编辑:是“滚动:'是'”参数不起作用吗?

Otherwise, I think, you can to edit/overwrite the Fancybox CSS :

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

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

Or something like this. I've do that for a previous project, but don't have the code under the hand to give you the exact syntax.

或类似的东西。我已经为以前的项目这样做了,但手边没有代码来为您提供确切的语法。

回答by JFK

You actually need to set the option

您实际上需要设置选项

'scrolling' : 'yes',

That will create scroll bars inside fancybox so you can browse long content.

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

回答by Carlos Carhuamaca

Try with:

尝试:

'autoSize' : false

'autoSize' : 假