View Full Version : MouseOver Effect - Right Method?
Quick question. I am creating a mouse over effect for a couple of small icons and was just wondering if the method I am using is the most efficient and common way of achieving this. Wrapped below is the main part of the code I am using. It works and it's XHTML valid, however, I was wondering is this the best way to create a mouse over effect.
onmouseover="document.but.src='icon2.gif'"
onmouseout="document.but.src='icon1.gif'"
Hell Bomb
04-25-2010, 01:19 AM
*EDIT*
If I am not mistaken this uses some javascript so this may not be the best way to do it. I'll post back when I can find a better way to do it.
If anyone has any good ways to do this let me know :) I am having trouble finding the right method that will work well in vb3.8.5
I agree, java can be a little dirty in this case. I have it running without issue but I don't feel great about the way I'm doing this. It does work in all browsers, except IE6, of course :rolleyes:.
Thanks for posting :)
DavidsMods
04-27-2010, 04:09 PM
It could be possible for you to use CSS either. Something like:
<style type="text/css">
.myclass {
background: #000 url(PATH_TO_IMG);
}
.myclass:hover {
background: #000 url(PATH_TO_OTHER_IMG);
}
</style>
<div class="myclass">
Content
</div>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.