creating a button click effect - JQuery -


i wondering on how go recreating button pressed effect using jquery.

my ideas use event mouse click change image pressed image , after mouse releases, return original image. thoughts or ideas on ways accomplish this?

that should work. code be:

$("#button").mousedown(function(){ $("#img").attr("src", "img2.jpg"); }) $("#button").mouseup(function(){ $("#img").attr("src", "img1.jpg"); } 

hope helps!


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -