Prevent Background Image Flickering in IE

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

Comments

  1. User Avatar
    paul
    Permalink to comment#

    i really like this blog, keep making!!

  2. User Avatar
    Leonard Michael

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

    Example?

    • User Avatar
      Zach
      Permalink to comment#

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

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

    • User Avatar
      Zach
      Permalink to comment#

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

      Sub in the real brackets in the code

  3. User Avatar
    saverio

    graet

  4. User Avatar
    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

    • User Avatar
      Gatis Kaulinsh
      Permalink to comment#

      I am changing background images in realtime and before it i have great code to preload all my Website images but it does not help. This code does not help either. I am pretty sure at 100% that it can’t be fixed at all.

Submit a Comment

Posting Code

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag