fancybox2 固定宽度

发布于 2024-12-27 16:34:45 字数 301 浏览 2 评论 0原文

是否有一组配置允许我打开具有固定设置宽度的 FancyBox2 弹出窗口(内联类型)?如果高度弯曲也没关系,但我希望将宽度设置为特定尺寸。

我尝试过这样的事情:

$.fancybox( {content:msg, type:"inline", title:title, autoSize:false, minWidth:"250px", width:"450px", height:h, maxWidth:"450px"} );

但是如果我的内容恰好比 450px 宽,它只是扩展视图而不是使用更多高度。

Is there a set of configs that will allow me to open a FancyBox2 popup (inline type) with a fixed, set width? It's ok if the height flexes, but I want the width set to a particular size.

I've tried something like this:

$.fancybox( {content:msg, type:"inline", title:title, autoSize:false, minWidth:"250px", width:"450px", height:h, maxWidth:"450px"} );

But if my content happens to be wider than 450px, it just expands the view rather than using more height.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烧了回忆取暖 2025-01-03 16:34:45

您应该设置

width: 450

450 像素宽的框。

实际上,所有整数都应该不带引号来表示其以像素为单位的值,因此正确的语法应该是:

minWidth: 250,
maxWidth: 450,
width: 450

等等。

此外,您还应该将选项 fitToView 设置为 false 来固定size,否则 fancybox 将尝试重新调整框的大小以适合视口

You should set

width: 450

for a 450px wide box.

Actually all integer numbers should be written without quotes for their value in pixels so the correct syntax should be:

minWidth: 250,
maxWidth: 450,
width: 450

etc.

Additionally you should set the option fitToView to false too for a fixed size, otherwise fancybox will try to re-size the box to fit within the viewport

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文