Skip to content

Instantly share code, notes, and snippets.

@chicagoworks
Created December 26, 2010 17:22
Show Gist options
  • Save chicagoworks/755521 to your computer and use it in GitHub Desktop.
Save chicagoworks/755521 to your computer and use it in GitHub Desktop.
Fix flicker of background images in IE
//==== Fix flicker of background images in IE
//http://ajaxian.com/archives/no-more-ie6-background-flicker
//http://support.microsoft.com/?scid=kb;en-us;823727&spid=2073&sid=global
//http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=1104
//Executes proprietary command to force IE to cache all background images which prevents the browser from fetching the same image repeatedly when using CSS hover background repositioning
if($.browser.msie && parseInt($.browser.version) === 6) {
try {
document.execCommand("BackgroundImageCache",false,true);
} catch(e) {
// just in case
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment