即使在 IE7 中缓存,背景图像加载或显示也会延迟

发布于 2024-09-07 23:08:57 字数 248 浏览 2 评论 0原文

我有一个分隔符 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小…红帽 2024-09-14 23:08:57

据我所知,延迟不应该是因为单个 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).

残月升风 2024-09-14 23:08:57

有些事情你可以尝试。您可以尝试减小图像的大小,然后在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文