Coding with Jesse

Stop CSS Background Flickering in Internet Explorer 6

I was once again reminded of an IE6 bug I had forgotten about - background images flashing or flickering when the mouse hovers over them.

So, I went looking for a solution. Here's what I found:

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

Works like a charm. Turns out it's due to the browser not caching the background images. This command turns on background image caching.

Do you think this would be good code to add to the core jQuery library?

Published on October 18th, 2008. © Jesse Skinner

About the author

Jesse Skinner

I'm Jesse Skinner. I've been helping clients build web apps for over two decades. I love hearing from new people. If you'd like to work with me, please email me at [email protected].

Contact Jesse

Need help with a project? Any questions about my writing? I'd love to hear from you.

Email me at [email protected]