IE 预加载图像错误?
好的,我正在为我的图像滑块调用精灵中的图像。发生的情况是,当加载页面时,所有幻灯片图像都水平显示,从而使其看起来有问题。我们制定的解决方案是将图像设置为预加载。它在 Firefox 中工作正常,但在 IE 中似乎有问题。以下是重要的两行代码(由于 IE 中的另一个错误,我们已经放置了间隔符):
<div id="banner"><div class="slideshow"><!--[if IE]>
<img id="ban_images1" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images2" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images3" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images4" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images5" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images6" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images7" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images8" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images9" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images10" src="images/spacer.gif" width="900px" height="244" border="0"/>
<![endif]-->
<![if !IE]>
<img id="ban_images1" />
<img id="ban_images2" />
<img id="ban_images3" />
<img id="ban_images4" />
<img id="ban_images5" />
<img id="ban_images6" />
<img id="ban_images7" />
<img id="ban_images8" />
<img id="ban_images9" />
<img id="ban_images10" />
<![endif]>
</div>
Ban Images 只是指位于 main.gif 的 sprite。
为了进行预加载,我将以下代码放在 HTML 文件的末尾:
<div class="slideshowload"><img src="image/main.gif" /></div>
将以下代码放在 CSS 文件的末尾:
.slideshowload{display:none;}
有什么建议可以使其在 IE 中工作吗?
谢谢!
Okay, so I'm calling images from a sprite for my image slider. What happens is that when a page is loaded, all slideshow images are displayed horizontaly thus making it appear bugged. A solution we worked out was to set images to preload. It works fine in Firefox, but in IE it appears bugged. Here are the two lines of code that matter (we have put the spacer thing due to another bug in IE):
<div id="banner"><div class="slideshow"><!--[if IE]>
<img id="ban_images1" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images2" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images3" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images4" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images5" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images6" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images7" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images8" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images9" src="images/spacer.gif" width="900px" height="244" border="0"/>
<img id="ban_images10" src="images/spacer.gif" width="900px" height="244" border="0"/>
<![endif]-->
<![if !IE]>
<img id="ban_images1" />
<img id="ban_images2" />
<img id="ban_images3" />
<img id="ban_images4" />
<img id="ban_images5" />
<img id="ban_images6" />
<img id="ban_images7" />
<img id="ban_images8" />
<img id="ban_images9" />
<img id="ban_images10" />
<![endif]>
</div>
Ban Images simply refer to the sprite that is located at main.gif.
To do preloading, I put the following code at the end of my HTML file:
<div class="slideshowload"><img src="image/main.gif" /></div>
And the following code at the end of my CSS file:
.slideshowload{display:none;}
Any suggestions to make it work in IE?
THanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几点:
A few things: