Javascript 使用jQuery预加载fancybox图像iframe
我有一个Javascript 使用jQuery预加载fancybox图像iframe,javascript,jquery,html,iframe,fancybox,Javascript,Jquery,Html,Iframe,Fancybox,我有一个iframe,可以容纳一个图库。在我的主网页中,我有一个图像,点击后,它会打开fancybox的“那个”iframe 代码如下: <a class="fancybox fancybox.iframe popup" href="http://tambooflores.com.mx/iframe_colores.html" height="100%" width="100%" > some IMAGE here </a> $('.fancybox').fanc
iframe
,可以容纳一个图库。在我的主网页中,我有一个图像,点击后,它会打开fancybox的“那个”iframe
代码如下:
<a class="fancybox fancybox.iframe popup" href="http://tambooflores.com.mx/iframe_colores.html" height="100%" width="100%" >
some IMAGE here
</a>
$('.fancybox').fancybox();
$("a.popup").fancybox({
'hideOnContentClick' : true,
'width' : 676,
'height' : 630,
'type' : 'iframe',
'padding' : 16,
'onComplete' : function() {
$('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height
$('#fancybox-content').height($(this).contents().find('body').height()+30);
});
}
});
问题是我有8个iFrame和8个不同的库(每个库有20个图像)。当我点击其中任何一个时,都需要很长时间才能显示出来
所以我想在加载主网页时加载一半的图片
我还考虑在每个iframe中添加以下内容:
The content of IFrame
<script type="text/javascript">
//<![CDATA[
fireOnReadyEvent();
parent.IFrameLoaded();
//]]>
</script>
IFrame的内容
//
请坐
1.如何缩短装货时间?
2.如何改进加载或如何在加载功能中加载一半图像?我也遇到了同样的问题。我这样决定:
获取要加载的图像大小(高度或宽度),并将此结果变量作为div height或width值。就这些 它是一个包含这些Java脚本的php项目?如果是这样的话,我有一些技巧可以与大家分享。好吧,我使用php,但不是在这个特定的问题上,谢谢。你能举个例子吗,它是在onload函数中使用jquery吗?很抱歉,我没有很好地理解你的问题。很抱歉Facebook加载低分辨率的图像,并替换为原始图像。检查此链接: