I'm attempting to use some inline JavaScript to dynamically alter the CLASS of an image so that is changes when the image is hovered over.
Here's my stylesheet elements (simplified for testing purposes)...
Code:
.ssb img {
background-color: #f00;
}
.ssb_hov img {
background-color: #0f0;
}
And here's the code (I've replaced the rather long urls with "[URL]" to make it more readable...
HTML Code:
<a href="[url]" class="ssb" rel="nofollow" onmouseover="document.getElementById('delicious_4546').className='ssb_hov';" onmouseout="document.getElementById('delicious_4546').className='ssb';">
<img src="[url]" id="delicious_4546" alt="Delicious" title="Delicious" class="ssb" style="padding-left: 5px; padding-right: 5px" />
</a>
As far as I can tell, this should work. But it won't. I'm using Firefox.
Anybody have any idea what the problem is?
David.
|