IE6下默认不缓存背景图片,CSS里每次更改图片的位置时都会重新发起请求,用这个方法告诉IE6缓存背景图片

 

解决IE下图片作为背景时,有鼠标操作时的抖动问题

方法一、css(不推荐)

复制内容到剪贴板

代码:

html {
  filter: expression(document.execCommand("BackgroundImageCache", false, true));
}

方法二、js

复制内容到剪贴板

代码:

try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

相关文章: