Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Bare-bones rollover


gph - 5:09 am on May 13, 2002 (gmt 0)


Thanks Tedster, this appears to be a very specific problem that I've been unable to find an answer for.

I've gotten help on another forum where I was told that NN4 needs to pass the div id which works but then it won't work in any other browser.

Here is the original download sample from [dhtmlnirvana.com...] in which the only change I've made is to absolutely position the div. The positioning causes NN4 to not work and declare a javascript error. I've tried every other script I can find and the result is always the same when the rollovers are contained in an absolutely positioned div. Any idea what I can do to make it or another script work?

<html>
<head>
<title>Image Swap Test</title>
<script language="JavaScript">
img1 = new Image();img1.src = "img.jpg";
function swapIt(img, src) {
document.images[img].src = src;
}
</script>
<style type="text/css">
<!--
#eddie {
position: absolute; top: 200px; left: 200px;
}
-->
</style>

</head>
<body bgcolor="#408080">
<a href="#" onmouseover="swapIt('img1', 'img.jpg')" onmouseout="swapIt('img1', 'offimg.jpg')">
<img id="img1" name="img1" src="offimg.jpg" border="0">
</a>
<br>
<br>
<a href="#" onmouseover="swapIt('bad1', 'img.jpg')" onmouseout="swapIt('bad1', 'offimg.jpg')">
<img id="bad1" name="bad1" src="offimg.jpg" border="0">
</a>
<br>
<br>
<div id="eddie">
<a href="#" onmouseover="swapIt('blah1', 'img.jpg')" onmouseout="swapIt('blah1', 'offimg.jpg')">
<img id="blah1" name="blah1" src="offimg.jpg" border="0">
</a>
</div>
</body>
</html>


Thread source:: http://www.webmasterworld.com/javascript/46.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com