Simple Image Submit Button Rollovers with jQueryFriday, 18 April 2008
Have you ever wanted a simple rollover technique with a form submission button? Something like this:
With jQuery it's really easy. All you need to do is include a standard image form submission tag, like so:
<input type="image" name="submit" id="submit" src="enter.gif">
… and add the hover behavior to the submit input tag. Something like this:
This is just a simple example, but you could definitely spruce it up if you needed something more elaborate by adding/removing CSS attributes and the like. Check out the jQuery documentation for more on the hover event.
The benefit of using this method is that the form will be submitted using the standard form submission action, rather than by calling
submit() method directly will bypass these handlers.