IE6下链接伪类(:hover)CSS背景图片有闪动BUG,主要原因ie会再一次请求这张图片,或者说图片没被缓存。
例如:
CSS代码
- a:hover{background:url(imagepath)}??
常用的解决方案:
在页面底部添加以下IE6专用代码,让IE6缓存CSS背景图片至本地,这样a:hover时IE6就不会再重新向服务器请求加载背景图片了。
?
XML/HTML代码
- <!–[if?IE?6]>??
- <script type=”text/javascript”>??
- document.execCommand(”BackgroundImageCache”,?false,?true); ??
- </script>??
- <![endif]–>??
- ??
?
或者
?
XML/HTML代码
- ??
- <!–[if?IE?6]>??
- <script?type=text/javascript>????? ??
- try?{????? ??
- document.execCommand(“BackgroundImageCache”,?false,?true);????? ??
- }?catch(err)?{}????? ??
- </script>??
- <![endif]–>??
我以为使用背景图像来解决呢
用css spirite 就能解决