图像是't在colorbox中加载页面
Image isn't loading on page load in colorbox
我在正确加载时遇到了一些问题,因为图像有时不会显示,而只是一个白色的小盒子,一切都设置好了吗?-它起作用了,但我不明白为什么它不再起作用了。。
<script type="text/javascript">
jQuery(document).ready(function(){
if (document.cookie.indexOf('visited=true') == -1) {
var fifteenDays = 1000*60*60*24*15;
var expires = new Date((new Date()).valueOf() + fifteenDays);
document.cookie = "visited=true;expires=" + expires.toUTCString();
$.colorbox({width:"30%", inline:true, href:"#subscribe"});
}
});
</script>
<div style="display:none;">
<div id="subscribe" style="width:475px;">
<img src="<?= IMAGES_DIR; ?>/signup.jpg" alt="Sign Up To University Compare" />
</div>
</div>
要查看实时链接,请访问:http://universitycompare.com
我认为问题存在,因为当图像未完全加载(height: 0
)时,颜色框会计算其高度。因此,当加载完成时,试着调整它的大小,或者给它一个高度值。
$.colorbox({
width:"30%",
inline:true,
href:"#subscribe",
onComplete : function() {
$(this).colorbox.resize();
}
});
或
$.colorbox({
width:"30%",
inline:true,
href:"#subscribe",
height: "500px"
});
在.cboxLoadedContent
有一个属性height:0px;
这就是问题所在。试着改变它的价值,就会奏效。
相关文章:
- 如何使用url加载程序在webpack中导入多个图像
- 如何在生成下载文件时显示加载动画
- Colorbox插件正在加载其自身的两个实例
- jQuery Colorbox IE7 问题与内联 ajax 加载的内容
- Colorbox弹出窗口在Apache上工作正常,不会在nginx上加载图像
- .js脚本未在 Colorbox 插件中加载
- Colorbox未加载-简单代码
- 在用colorbox加载页面后尝试引用类
- 图像是't在colorbox中加载页面
- 无法加载colorbox js
- 在IE中Colorbox不能正确加载
- 当bxslider加载时,Colorbox在rel属性上断开
- 当css加载到body中时,Jquery Colorbox会破裂,这是一个可能的修复
- 将HTML内容加载到DIV后调整colorbox的大小
- colorbox在colorbox.resize上重新加载iframe内容的问题
- Cookie在colorbox加载时不工作
- 在colorbox中加载页面
- JavaScript (colorbox)在通过jquery. load()加载的内容中不起作用
- JQuery Colorbox作为加载屏幕-Won'有时不能关门
- jQuery Colorbox插件未加载图像