如何在运行时调整Fancybox的大小? [英] How do you resize Fancybox at runtime?

查看:93
本文介绍了如何在运行时调整Fancybox的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何在运行时调整jQuery Fancybox的大小吗?

Does anyone know how to resize the jQuery Fancybox during runtime?

初始化fancybox时,我可以这样做:

When initializing the fancybox I can do this:

$("tag").fancybox({ 'frameWidth': 500, 'frameHeight': 700 });

我正在用动态内容填充fancybox,并希望它根据内容调整大小.

I am filling the fancybox with dynamic content and I want it to resize according to the content.

推荐答案

如果您正在使用1.3版的Fancybox,则可以使用一种调整大小的方法:

If you are using version 1.3 of Fancybox, there is a resize method:

$.fancybox.resize();

$.fancybox.resize();

对于版本 2.x的Fancybox ,可以执行以下操作:

For version 2.x of Fancybox the same would be done with:

$.fancybox.update()

$.fancybox.update()

将根据其中的活动内容大小来调整其功能.

Which will resize the active fancybox based on the size of the content inside it.

这篇关于如何在运行时调整Fancybox的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆