Guest Russell Posted December 13, 2006 Share Posted December 13, 2006 <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 More sharing options...
ste Posted December 13, 2006 Share Posted December 13, 2006 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 More sharing options...
ste Posted December 13, 2006 Share Posted December 13, 2006 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 More sharing options...
Skemcin Posted December 13, 2006 Share Posted December 13, 2006 Try this:http://w3schools.invisionzone.com/index.ph...ost&p=50962BTW, that is Dreamweaver Generated code - I've always preferred hand written scripts - much cleaner. Link to comment Share on other sites More sharing options...
aspnetguy Posted December 13, 2006 Share Posted December 13, 2006 just to be picky. It is never a good idea to use bitmaps (.bmp) on a website. The same image convert to gif, jpg, or png wqould be 10 times smaller with the same quality. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now