Posted By

vijayrajesh on 01/17/13


Tagged

image jquery img src swap attr


Versions (?)

jQuery Image Source Swap with attr() function


 / Published in: jQuery
 

URL: http://blog.pixelthemes.com/ideas/jquery-image-source-swap-with-attr-function

I have made a small jQuery snippet to demo the image swapping with attr() funciton. The demo uses 2 images with classes img1 and img2 respectively. On a click of a button, the images are swapped.

Basically the script stores “src” value into a variable and then it is used to swap 2 image sources.

Report this snippet  

You need to login to post a comment.