即使在 IE7 中缓存,背景图像加载或显示也会延迟
我有一个分隔符 li,它有一个背景图像,在展开的树形菜单中,它可能会使用 css 出现多次:
.simpleTree .line {
background:url("/images/Css/gridLine.gif") no-repeat 0 0;
即使它被缓存(来自以前的实例),在 IE7 中仍然有轻微的延迟(~500 - 1 秒) )在所有背景图像启动之前。有没有更好的方法来做到这一点或者让它更快?
I have a seperator li which has a background image, in an expanded tree menu, it may appear several times using the css:
.simpleTree .line {
background:url("/images/Css/gridLine.gif") no-repeat 0 0;
Even tho it is cached (from previous instances), there is still a slight delay in IE7 (~500 - 1sec) before all the background images fires up. Is there a better way to do this or make it quicker?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,延迟不应该是因为单个 gif 图像。使用 YSlow 或 页面速度。也许其他一些内容会阻止您的图像快速显示(例如 JavaScript 执行)。
As far as I can tell the delay shouldn't be because of a single gif image. Check your site with YSlow or PageSpeed. Maybe some other content is blocking your image to appear fast (like javascript execution).
有些事情你可以尝试。您可以尝试减小图像的大小,然后在 CSS 中使用标签“repeat-x”或“repeat-y”。
在某些情况下,.gif 不是显示图像的最佳类型,您可以尝试以不同的格式保存图像,看看它们是否会变小。
此致
There are some things that you can try. You can try to reduce the size of your image and than in the CSS use the TAG "repeat-x" or "repeat-y".
In some cases, .gif's are not the best type to display images, you can try saving your image in diferent formats and see if they get smaller.
Best Regards