Grow your CSS skills. Land your dream job.

Last updated on:

Prevent Background Image Flickering in IE

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

Comments

  1. paul
    Permalink to comment#

    i really like this blog, keep making!!

  2. Leonard Michael

    Silly question perhaps, but how do you use/implement this?

    Example?

    • Permalink to comment#

      I believe you just put it in your head, like this:

      try {
      document.execCommand(“BackgroundImageCache”, false, true);
      } catch(err) {}

    • Permalink to comment#

      [script type=”javascript”]
      try {
      document.execCommand(“BackgroundImageCache”, false, true);
      } catch(err) {}
      [/script]

      Sub in the real brackets in the code

  3. saverio

    graet

  4. sujji
    Permalink to comment#

    hi,
    i used the above code . but still i am facing image flickering. i have to place the names of the images in the place of BackgroundImageCache. please help me

Leave a Comment

Posting Code

Markdown is supported in the comment area, so you can write inline code in backticks like `this` or multiline blocks of code in in triple backtick fences like this:

```
<div>Example code</div>
```

You don't need to escape code in backticks, Markdown does that for you. If anything screws up, contact us and we can fix it up for you.

*May or may not contain any actual "CSS" or "Tricks".