使用以下 JS 宽度不会被调整。 '750' 或 '750px'
时,它不会得到调整
$('a#city-prompt').fancybox({
'width': 750
});
当我使用我在 fancybox 论坛对此进行了讨论,但尚未得到回复
Using the following JS the width isn't being adjusted. It doesn't get adjusted when I use '750'
or '750px'
$('a#city-prompt').fancybox({
'width': 750
});
I've posted on the fancybox forums about this and haven't gotten a response
发布评论
评论(7)
您可能必须将
autoSize
设置为false
:关于
width
来自 文档:You probably have to set
autoSize
tofalse
:About
width
from the documentation:这里的答案都不适合我,但这解决了问题:
'autoSize':false
是丢失的键None of the answers here worked for me, but this did the trick:
The
'autoSize':false
was the missing key以像素为单位写入宽度时,请确保不包含 '。 而不是
因此,您应该使用“宽度”:100,
“宽度”:“100”,希望有帮助......
Make sure to not include the ' when writing out width in pixels. So instead of
'width' : '100', you should have 'width' : 100,
Hope that helps...
试试这个。
您需要将
autoSize
设置为false
:Try this.
You need to set
autoSize
tofalse
:在 Fancybox 版本 2 及更高版本中,使用
'autoSize':false
Fancybox 文档
In Fancybox version 2 and above use
'autoSize':false
Fancybox Documentation
将
_get_zoom_to
(第 690 行)从 更改为
Change
_get_zoom_to
(on line 690) fromto
除了其他答案之外,为了解决高度问题,我更改了行 998
:
to.height = currentOpts.height + double_padding;
到:
to.height = parseInt(currentOpts.height) + parseInt(double_padding);
In addition to the other answers, to fix the height issue I changed line 998
from :
to.height = currentOpts.height + double_padding;
to:
to.height = parseInt(currentOpts.height) + parseInt(double_padding);