I have a little problem with a JavaScript I've written. It works in Mozilla and Safari, but not in Internet Explorer, so I need a little help.
The page can be found here: http://hightower.urbanturban.no/fatalerror/menu.html
And the hover effect is supposed to look like this: http://hightower.urbanturban.no/fatalerror/hover.gif
The Javascript:
A sample from the HTML code:
And the IE error message:
The page can be found here: http://hightower.urbanturban.no/fatalerror/menu.html
And the hover effect is supposed to look like this: http://hightower.urbanturban.no/fatalerror/hover.gif
The Javascript:
Code:
var preload=new Image();
preload.src="images/hover.gif";
function changeImages(img_name,img_src) {
document[img_name].src = img_src;
}
Code:
<a href="index.html" class="menu"
onmouseover="changeImages('index', 'images/hover.gif')"
onmouseout="changeImages('index', 'images/nhover.gif')">
<img src="http://hightower.urbanturban.no/fatalerror/images/nhover.gif"
alt="" id="index" />Home</a>
document[...] is null or not an object