我有一个网页,其中提供了几个链接,以查看图片库和(YouTube/Vimeo)视频。
如果在查看视频弹出窗口之前单击并查看了图片库链接,那么一切都很好,并且显示得很好。但一旦点击并查看了视频链接,然后返回以再次打开图片库,则图像视图的颜色框将在短窗口中打开。
是否需要为图片库重置某些窗口/大小参数?
你们中有谁遇到过这样的问题吗?
<link href="css/gallery_colorbox.css" rel="stylesheet" type="text/css" />
<script src="jquery-colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
<script>
//$.noConflict();
jQuery(document).ready(function(){
if(jQuery(window).width() < 800)
{
jQuery(".photo_gallery").colorbox({rel:'photo_gallery', maxWidth:"100%", maxHeight:"600px", current:"{current}/{total}"});
} else {
jQuery(".photo_gallery").colorbox({rel:'photo_gallery', maxWidth:"800px", maxHeight:"600px", current:"{current}/{total}"});
}
jQuery(".iframe").colorbox({iframe:true, fastIframe:false, width:"450px", height:"480px", transition:"fade", scrolling:false});
jQuery(".youtube_video").colorbox({iframe:true, innerWidth:740, innerHeight:490,
onComplete : function() {
jQuery('.cboxIframe').parent("#cboxLoadedContent").addClass('iframewrap');
jQuery('.cboxIframe').closest("#colorbox").addClass('coloriframebox');
}
});
});
</script>
该页面是用php编写的,并通过<div id="abc" class="youtube_video">
或<div id="xyz" class="photo_gallery">
等调用colorbox视图。
https://stackoverflow.com/questions/41473284
复制相似问题