用css Sprites的时候IE6的一个小bug

如果在使用 css Sprites 背景图你没有指定一次,而是采用 Workaround,而非 Fix

那么就会出现一个bug :如果IE 的缓存控制为不缓存,每次都去服务器取资源的话,背景图会闪

这个是 chen yagnjian 提供的方案:

Client-side fix:
Tools  >  Internet Options  
>  'Settings' under Temporary Internet files  
>  Select 'Automatically'  >  OK 


CSS FIX - Insert in your CSS:
html {
  filter: expression(document.execCommand("BackgroundImageCache", false, true));
} 


Javascript FIX:
<script type="text/javascript">
try {
document.execCommand('BackgroundImageCache', false, true);
}
catch(e) {};
</script> 


转载请注明:小贺的博儿/小河的博儿

原文地址:https://www.cnblogs.com/NetSos/p/1885208.html