IE background flicker

2019-04-13 15:10发布

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.

1条回答
啃猪蹄的小仙女
2楼-- · 2019-04-13 15:23

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.

查看更多
登录 后发表回答