Friday, September 5, 2008

IE6 Disappearing Images Solution

After a bit of testing on my issue with the sprites disappearing on hover, I came up with a temporary solution. I still wasn't satisfied with it, and did some more searching on Google. That lead me to a nice script that fixes the problem. Here are the two solutions:

Temporary Fix:
Take the images being used for each link, and set them as the background of the ul or table you are using for the navigation. I made a quick attempt to set the image as the background of the li that contains the anchor, but that still flashed. It seemed to work fine putting it in the background of the ul. This solution does not fix the disappearing images, just makes it less noticeable.

Script Fix:
Doing a Google search led me to this script:
<script type="text/javascript">
document.execCommand("BackgroundImageCache",false,true);
</script>
and that seemed to fix the problem just fine. I have more testing to do, but hopefully this will be my final solution.

No comments: