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

 

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

方法一、css(推荐使用)

代码:

     div{*zoom:1;}

    html {
            zoom:expression(function(ele) {
            ele.style.zoom = "1";
            document.execCommand("BackgroundImageCache", false, true);
            }
            (this));
           }

方法二、js

代码:

try {

  document.execCommand('BackgroundImageCache', false, true);

} catch(e) {}

 

     方法三、css expression (不推荐)

html {

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

}

 

     其实现在解决问题的做法大多采用css 背景的定位。即整个页面做所有图标做在一张图上。

相关文章:

  • 2022-12-23
  • 2021-12-28
  • 2021-10-01
  • 2021-10-14
  • 2021-06-16
  • 2021-11-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-12
  • 2021-11-09
  • 2022-12-23
  • 2022-01-27
  • 2022-02-21
  • 2022-12-23
相关资源
相似解决方案