jquery 03 – Swapping images with mouse events


Views: 149 | Duration: 9:14
Likes: 1 | Dislikes: 2

So you want to hide or show an image because the mouse rolled onto something on the page? That’s a mouse event! There’s more than one kind, and unfortunately, there’s no toggle option for mousing in and out, or for pressing and releasing the mouse button. No worries — you can still make it work, as log as you know how to chain event handlers together.


mouseenter, mouseleave events
mousedown, mouseup events
.attr() method, to change the image


There is no code for this video. There are links to code in other videos in this series.


jQuery Event Basics https://learn.jquery.com/events/event-basics/
jQuery and HTML Attribute https://api.jquery.com/category/attributes/
jQuery Mouse Events https://api.jquery.com/category/events/mouse-events/

Subscribe to the JqueryPlugins.net mailing list:
* indicates required


Pin It on Pinterest