Website javascript problem

Associate
Joined
4 Feb 2007
Posts
606
I am doing a small test website and would like some one to give me advise on some javascript as i really dont know much about it.
http://www.pageresource.com/jscript/jhover3.htm

This is the script i want but instead of text links i want to be able to have image links, it would be a great help is someone could rewrite or tell me how to do this

Im using dreamweaver MX 2004
 
A more understandable way :)
Plus with less code...

Code:
<body>
<script>
function change1(NewImage){
var x=document.getElementById("ThisIsTheImgToChange")
x.src=NewImage
}
</script>

<img src="/path/to/image" onMouseover="change1('new/path/to/pic')" onMouseout="change2('old/path/to/pic') />
<img src="/path/to/image" onMouseover="change1('new/path/to/pic')" onMouseout="change2('old/path/to/pic') />
<img src="/path/to/image" onMouseover="change1('new/path/to/pic')" onMouseout="change2('old/path/to/pic') />



<img id="ThisIsTheImgToChange" src="/path/to/OriginalImage" />
</body>

Haven't tired it, but all it does is replace the image src (With the "ThisIsTheImgToChange" id) with the one listed in the onMouseover event. Its then changed backl to normal using the onMouseOut.
 
Last edited:
Back
Top Bottom