IE背景闪烁 [英] IE background flicker

查看:216
本文介绍了IE背景闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到问题,当我切换到网站上的其他页面时,我的背景变成白色并再次加载。我知道这与IE缓存有关,并对此进行了一些研究。我已经尝试了最常见的修补程序,包括css和javascript,就像本网站上的修复程序一样: http://ieflicker.com/但它们都不起作用。
$ b

UPDATE(一些代码)



该网站将BODY与 background-image:url('background1.jpg')作为其CSS的一部分。这似乎加载图像一次,并缓存在所有的浏览器,但IE10。 IE10似乎每次都会重新加载它。显然IE10不会缓存通过CSS加载的图片,尽管所有的黑客都是如此。你需要明确地加载它。例如。如果你的身体风格提到:

  background-image:url('background1.jpg')


将此添加到您网页的HTML中:

 < img src ='background1.jpg'style ='display:none'/> 

现在这个会加载并缓存图片,并且避免闪烁。


I have the problem that when I switch to other pages on the site, my background turns white and loads again. I know it has something to do with the IE cache and did some research about it. I already tried the most common fixes, both css and javascript, like the ones on this site: http://ieflicker.com/ but none of them works.

UPDATE (some code)

The site uses BODY with background-image: url('background1.jpg') as a part of its CSS. This seems to load image once and cache it in all the browsers but IE10. IE10 seems to reload it every time.

解决方案

Apparently IE10 doesn't cache image loaded via CSS despite all the hacks. You need to explicitly load it. E.g. if your body style mentions:

background-image: url('background1.jpg')

add this to your page's HTML:

<img src='background1.jpg' style='display:none' />

Now this will load and cache the image and the flicker will be avoided.

这篇关于IE背景闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆