處理IE6下默認不緩存背景圖片的問題

處理IE6下默認不緩存背景圖片的問題
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 背景的定位。即整個頁面做所有圖標做在一張圖上。


http://www.cnblogs.com/fighting_cp/archive/2010/08/30/1812538.html
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章