首次单击时 Colorbox 未打开至所需的宽度和高度

发布于 2024-11-15 19:15:17 字数 253 浏览 7 评论 0原文

我使用 colorbox 和 ajax 来提取 html 文件。当我第一次单击链接加载 colorbox 时,弹出窗口的宽度和高度太小,并且不会显示其中的图像和 div。当我第二次单击同一链接时,颜色框将打开所需的宽度和高度参数。

在脚本中,我之前将宽度设置为 false,因此它会根据内容动态调整。我开始遇到这个问题,我尝试将宽度更改为 940,但仍然存在这个问题。

有什么想法可能导致它吗?

(相关网站是 jcoledesign.com)

I'm using colorbox with ajax to pull in html files. When I click the link to load colorbox the first time the width and height of the popup are way to small and won't show the images and divs inside of them. When I click the same link the second time colorbox opens up to the desired width and height parameters.

In the script i previously had width set to false so it would adjust dynamically to the content. I began having this problem and I tried changing the width to 940, but still have this problem.

Any ideas what could be causing it?

(The site in question is jcoledesign.com)

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

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

发布评论

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

评论(3

这个俗人 2024-11-22 19:15:17

请参阅常见问题解答中的此条目:

第一次打开 ajax/内联内容时 ColorBox 的尺寸太小
http://jacklmoore.com/colorbox/faq/#faq-img

See this entry in the FAQ:

ColorBox is sized too small the first time ajax/inline content is opened
http://jacklmoore.com/colorbox/faq/#faq-img

久而酒知 2024-11-22 19:15:17

给图像标签明确的高度和宽度,即

<img src='myimage.jpg' />

变成

<img src='myimage.jpg' width=500 height=500 />

Give the image tag explicit height and width, i.e.

<img src='myimage.jpg' />

becomes

<img src='myimage.jpg' width=500 height=500 />
放飞的风筝 2024-11-22 19:15:17

如果有人需要的话,还有一个解决方案。

        $.colorbox({inline:true, href:"#form"},function(){
                $('#cboxContent').css("height","160");
                $('#cboxMiddleLeft').css("height","160");
                $('#cboxMiddleRight').css("height","160");                  
        });

您只需根据您拥有的内容设置宽度和高度即可。

:)

One more solution if anyone need for this.

        $.colorbox({inline:true, href:"#form"},function(){
                $('#cboxContent').css("height","160");
                $('#cboxMiddleLeft').css("height","160");
                $('#cboxMiddleRight').css("height","160");                  
        });

You just have to set the with and height as per the content you have.

:)

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