0

Possible Duplicate:
Jquery IE6 hover problems, keeps loading background image.

Hello I am trying to solve this problem: I have this div with a background image. The background image position change on mouse move or some other evets. The problem is that on position change only IE6 seem to reload image causing a empty image for some seconds.

<div style="position: absolute; top: 0px; left: 0px; background: url("img/one.jpg") repeat scroll -1380px -252px transparent;"></div>

How can I avoid this bug in IE6? Is there a trick?

Community
  • 1
  • 1
albanx
  • 6,193
  • 9
  • 67
  • 97
  • First question would be why are you still coding for IE6? Conventional wisdom seems to be to do as little as possible to support that antique piece of crap and encourage users to move to a more modern browser. –  Mar 15 '11 at 11:45
  • @Chuck My bosses wanted this compatibility for all IE, I hate IE I hate it but i should code for it too – albanx Mar 15 '11 at 11:58
  • I understand completely - I used to work somewhere that, as recently as a year ago, IE6 was the corporate standard. –  Mar 18 '11 at 11:34

2 Answers2

1

CSS

html {
  filter: expression(document.execCommand("BackgroundImageCache", false, true));
}

Source.

You may want to place this in a conditional comment to target IE6 exclusively.

Community
  • 1
  • 1
alex
  • 479,566
  • 201
  • 878
  • 984
0

Try this CSS solution to fix the IE6 background image bug:

html {
  filter:expression(
    document.execCommand("BackgroundImageCache", false, true)
  );
}

(from this 2006 article)