我有一个iframe
拥有一个画廊。在我的主网页中,我有一个图像,点击后,它会打开带有fancybox的“那个”iframe。预加载fancybox图像iframe与jQuery
的代码是这样的:
<a class="fancybox fancybox.iframe popup" href="http://tambooflores.com.mx/iframe_colores.html" height="100%" width="100%" >
some IMAGE here
</a>
为的fancybox的脚本是:
$('.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个I帧有8节不同的画廊(20个图像每)。当我点击其中的任何一个时,显示时间就会很长。
所以我想在加载主网页时加载大概一半的图像。
我也在想每个iframe中添加此的:
The content of IFrame
<script type="text/javascript">
//<![CDATA[
fireOnReadyEvent();
parent.IFrameLoaded();
//]]>
</script>
请带负载的look at the fiddle 1.如何轻微时间? 2.如何提高加载或如何在加载函数中加载一半图像?
这是一个包含这些javascripts的php项目?是的,我有一些提示,我可以与你分享。 – RicardoGonzales
好吧,我使用PHP,但不是在这个特定的问题,谢谢。 – cMinor