Preventing The IE6 CSS Background Flicker

Written by David Walsh on August 8, 2007 · 5 Comments

One of the nagging issues that Internet Explorer creates is a flicker on anchor tag background images. Did you know, however, that there is a quick and easy way to prevent that problem using a little bit of JavaScript? Simply place the following JavaScript code in the header section of your website, refresh the page, and bid adieu to another IE6 issue.

Comments

  1. You can do the same thing by using .htaccess to cache the file. I don’t know if there is a minimum cache offset but a day works. And if you are following the yslow guidelines you get this as an added benefit. The flicker is actually caused by IE revalidating the image. The advantage to this method beyond speeding up your site is it doesn’t require JavaScript to work.

  2. Awesome man! Thanks for sharing this.

  3. Thanks, this worked great! A simple solution to an annoying behavior.

  4. Hi,

    Where can I get the Javascript code to resolve the issue?

    regards,

    N

  5. valentina March 4, 2011

    great! and thank you!

Be Heard

Tip: Wrap your code in <pre> tags or link to a GitHub Gist!

Use Code Editor
Older
Advanced CSS Links - Spice Up Your Links
Newer
Remove Internet Explorer's Gallery Image Toolbar