chestertb
08-10-2004, 04:58 AM
Hi All,
Something strange has happened to my Internet Explorer 6.
I have been using a very simple mouseover function to swap images.
<script language="javascript">
mb=new Image;mb.src="images/help-s.gif";
ma=new Image;ma.src="images/help.gif";
function highlight(choice)
{
imgName = choice;
imgOn = eval('mb.src');
document[imgName].src = imgOn;
}
function normal(choice)
{
imgName = choice;
imgOn = eval('ma.src');
document[imgName].src = imgOn;
}
</script>
In the body, this;
<a href="apage.htm" onmouseover="highlight('t1')" onmouseout="normal('t1')"><img name="t1" id="t1" src="images/help.gif"></a>
It has been working for more than a year, and it still works as per spec in Mozilla /Netscape.
Trouble is, IE (actually Crazy Browser) doesn't cache the images any more, so each time you mouse over it ignores the preloaded images and goes to the server which means, or course, that the mouseover effect is anything but instant. Note that it does this every time, you mouseover, not just the first time.
This seems to have happened since the last "security update". I'm not even going to try top second guess what the evil empire might have done to cause this, so I thought I'd turn to the brains trust here.
Is there a different way to achieve the mouseover image swap effect?
Thanks
CTB
Something strange has happened to my Internet Explorer 6.
I have been using a very simple mouseover function to swap images.
<script language="javascript">
mb=new Image;mb.src="images/help-s.gif";
ma=new Image;ma.src="images/help.gif";
function highlight(choice)
{
imgName = choice;
imgOn = eval('mb.src');
document[imgName].src = imgOn;
}
function normal(choice)
{
imgName = choice;
imgOn = eval('ma.src');
document[imgName].src = imgOn;
}
</script>
In the body, this;
<a href="apage.htm" onmouseover="highlight('t1')" onmouseout="normal('t1')"><img name="t1" id="t1" src="images/help.gif"></a>
It has been working for more than a year, and it still works as per spec in Mozilla /Netscape.
Trouble is, IE (actually Crazy Browser) doesn't cache the images any more, so each time you mouse over it ignores the preloaded images and goes to the server which means, or course, that the mouseover effect is anything but instant. Note that it does this every time, you mouseover, not just the first time.
This seems to have happened since the last "security update". I'm not even going to try top second guess what the evil empire might have done to cause this, so I thought I'd turn to the brains trust here.
Is there a different way to achieve the mouseover image swap effect?
Thanks
CTB