Click to See Complete Forum and Search --> : Onmouseover image border changing
bagzy
07-19-2004, 06:11 PM
Hi,
I was wonddering if it was possible to change the background colour of a link image using the onmouseover event, and if so, how?
gil davis
07-19-2004, 06:38 PM
If it truly is a link, then you could easily use CSS.
a:hover img {background-color: whatever}
If you want to use JS:
<a href="whatever" onmouseover="this.style.backgroundColor='red'" onmouseout="this.style.backgroundColor=''"><img src="lilguy2.gif"></a>
It actually changes the background color of the anchor, but it is easier to do it this way, thanks to the "this" operator.
bagzy
07-19-2004, 06:45 PM
OK thanks.
I will probably go with the JavaScript option, as i'm still a bit of a noob when it comes to CSS :P
IncaWarrior
07-19-2004, 11:43 PM
but they css is so easy