rollover image with buttons

2019-08-30 18:07发布

问题:

Is there a way to make a form input of type image to have a rollover image?

回答1:

Try this?

<input type="image" value="someValue" src="yourImage.gif" width="widthInPixels" height="heightInPixels" onmouseover="this.src='yourImageRollover.gif';" onmouseout="this.src='yourImage.gif';"> 


回答2:

The same way as any other image. Change the src property when the mouseover event fires.



回答3:

I would just use a normal submit input and use css sprites on it.

http://www.alistapart.com/articles/sprites