第一次打开时,jQuery colorbox看起来不正确,然后再罚款 [英] jquery colorbox looks wrong the first time opened and then fine after that

查看:68
本文介绍了第一次打开时,jQuery colorbox看起来不正确,然后再罚款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图动态地(使用ajax)获取一些内容,并使用它创建一个模式(使用colorbox插件).问题在于内容中包含一些图像.我认为模态在其高度或宽度计算之类的内容中并未将其计算在内.因此,如果您关闭模态然后再打开它,看起来就很好. (第一次打开它时,它具有滚动条,可以访问其余的模态.)

I'm trying to dynamically (using ajax) get some content and create a modal (using the colorbox plugin) with it. The problem is that the content has some images in it. I think that the modal doesn't count them in it's height or width calculation or something. So if you close the modal and then open it it looks fine. (The first time you open it, it has the scroll bars to access the rest of the modal).

想法?

推荐答案

看起来您只需要添加图像的height和width属性即可.像这样:

It looks like you just have to add the image's height and width attributes. Like so:

<img src="/path/to/image.jpg" width="100px" height="100px" />

这篇关于第一次打开时,jQuery colorbox看起来不正确,然后再罚款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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