Jump to content

Need help with roll over buttons :$


Guest Russell

Recommended Posts

Guest Russell
<a href="http://www.altscripts.net" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('b1','','rollbutton.gif',1)"><img src="b1.bmp" alt="Alternative Scripting" name="b1" border="0" id="b1"></img></a>

^ I got that, All I want for it to do is on mouse over show my .gif and on mouse out restore the primary image which would be b1.bmp the image I'm trying to swap it with is rollbutton.gif (the image I will swap all buttons to) it would also be kwl if there was a way for you guys to set it in CSS like mouse-over-button { swap-img blaalalala } because all images will be different but they will all go to the same file when the mouse goes over it. sorry if i confused anyone :)

Link to comment
Share on other sites

Im no javascript expert but it looks like that is only part of the code, could you post the rest? unless your missing that. in that case that is why it wont work. e.g. you say onmouseout="MM_swapImgRestore()" but MM_swapImgRestore() hasnt been defined

Link to comment
Share on other sites

it would also be kwl if there was a way for you guys to set it in CSS like mouse-over-button { swap-img blaalalala } because all images will be different but they will all go to the same file when the mouse goes over it. sorry if i confused anyone :)
heres a way you could do that. in this example for a menu
<head><style type="text/css">	#menu a {		display:block;		width:200px; /* change to whatever you need */		background: url("button.gif") 0 0 no-repeat;		text-decoration: none;		}	#menu a:hover {			background: url("button_hover.gif") 0 0 no-repeat;		}	#menu a:active {		background: url("button_active.gif") 0 0 no-repeat;		}	</style></head><body><div id="menu">	<a href="">Menu item 1</a>	<a href="">Menu item 2</a>	<a href="">One more </a></div></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...