IE6下背景图片通过css文件控制的情况下,如果图片位置发生更改,那么请会重新发起图片请求,在图片多并大时,这种请求直接导致前端卡死、延时。解决方法,在页面头部添加以下JS:
/*Use Object Detection to detect IE6*/
var ie6 = document.uniqueID /**//*IE*/
&& document.compatMode /**//*>=IE6*/
&& !window.XMLHttpRequest /**//*<=IE6*/
&& document.execCommand;
try{
if(ie6){
document.execCommand("BackgroundImageCache", false, true) /**//* = IE6 only */
}
}catch(err){};