View Single Post
  #5 (permalink)  
Old 03-04-10, 01:23 PM
Frogger Frogger is offline
Wannabe Coder
 
Join Date: Jul 2006
Posts: 149
Thanks: 5
Thanked 0 Times in 0 Posts
Thanks coderobber. You have made a very good point.

How would I then go about if I wanted to change more than one mouse over image.

EG

Code:
<a onmouseover="swapImageOver(test1)" onmouseout="swapImageOut(test1)" ><img id="test1"> or Text here 1</a> 

<a onmouseover="swapImageOver(test2)" onmouseout="swapImageOut(test2)" ><img id="test2"> or Text here 2</a>
Something with the code below would have to be done otherwise it will only chnage the one image.

Code:
function swapImageOver(id){
document.getElementById('test').src='differentimag e.jpg';
}

function swapImageOut(id){
document.getElementById('test').src='someimage.jpg ';
}
Reply With Quote