Home  >  Article  >  Web Front-end  >  IE6图片加载的一个BUG解决方法_javascript技巧

IE6图片加载的一个BUG解决方法_javascript技巧

WBOY
WBOYOriginal
2016-05-16 18:23:261078browse

代码如下:

复制代码 代码如下:



注:这个BUG以前就已经发现了,这里只是再次提出来。

更详细的说明可以参考下面的文章:
IE6下默认不缓存背景图片,CSS里每次更改图片的位置时都会重新发起请求,用这个方法告诉IE6缓存背景图片
解决IE下图片作为背景时,有鼠标操作时的抖动问题
方法一、css(不推荐)
复制代码 代码如下:

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

方法二、js
复制内容到剪贴板
复制代码 代码如下:

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

其实现在解决问题的做法大多采用css 背景的定位。即整个页面做所有图标做在一张图上。(以mail 163例)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn