Forum Moderators: open
Here is some of the affected code - very basic preload script:
<SCRIPT language="JavaScript">
<!--
realestate = new Image();
realestate.src = "Images/nav/ER-Real-Estate-On.jpg";
-->
</SCRIPT>
</HEAD>
<BODY>
<a href="realestate.htm" onmouseover="realestate.src='Images/nav/ER-Real-Estate-On.jpg';" onmouseout="realestate.src='Images/nav/ER-Real-Estate-Off.jpg';"><img src="Images/nav/ER-Real-Estate-Off.jpg" name="realestate" border="0" width="77" height="13"></a>
Any and all info is appreciated.
I've stopped designing with image rollovers and gone completely to CSS hover behaviors because I'm not sure that caching works predictably on IE anymore.
tedster - I defined image dimensions in the script, but I am not preloading the "off" state images as you suggested. This doesn't seem necessary as the off state is already loaded just from D/L-ing the page. Do you disagree?
This is so frustrating.
Thinking a bit further, on a slow connection, preloading both states from the HEAD would give you better shot at having a visually functioning menu early on in the page rendering process. But that's about it.
Unfortunately none of these ideas seem to work
It wouldn't surprise me that adding image dimensions doesn't fix the problem in all builds of IE6. I have an early build which I only haul out for page testing or PageRank checking, and it does work there.
Maybe I'll download a new build and poke around some more.
I hear you about CSS... unfortunately the Marketing Dept. still insists on having smooth, flawless image text. They won't take my advice... what the heck do I know? I'm only the webmaster!
Drinks are on me if someone can me with this issue.
I concentrated on the script, when the actual problem lies in the img tag!
Change this
<a href="realestate.htm" onmouseover="realestate.src='Images/nav/ER-Real-Estate-On.jpg';" onmouseout="realestate.src='Images/nav/ER-Real-Estate-Off.jpg';"><img src="Images/nav/ER-Real-Estate-Off.jpg" name="realestate" border="0" width="77" height="13"></a> to this
<a href="realestate.htm" onmouseover="[b]theimg[/b].src=[b]realestate.src[/b];" onmouseout="[b]theimg[/b].src='Images/nav/ER-Real-Estate-Off.jpg';"><img src="Images/nav/ER-Real-Estate-Off.jpg" name="[b]theimg[/b]" border="0" width="77" height="13"></a> You can't use the same name for the variable and the image ;)
I know this doesn't resolve the issue but if your Options are such that the browser checks for Newer versions of stored pages
'every visit to the page'
then I suspect this is the problem.
If you change this option to
'automatically'
the problem should go away.
I know this doesn't resolve the problem, it might just help to solve it.
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {;
document[arguments[0]].src = arguments[1];
}
}
var preloadFlag = false;
function preloadImages() {
if (document.images) {
search_button_01_over = newImage("images/search-button_01-over.gif");
search_button_01_down = newImage("images/search-button_01-down.gif");
preloadFlag = true;
}
}
[edited by: tedster at 3:48 am (utc) on Mar. 4, 2003]
[edit reason] remove url [/edit]