I would simply like to animate the transition between the original picture and its replaced src picture on hover and animate again when off hover.With my current code, the image swap works properly, but I cant seem to figure out the animation/fade-in/fade-out. You are at: Home » jQuery img src animation with fade.Im trying to create an animation which changes the image source of an img element every 4.6 seconds using a fade in / out animation. A tutorial on how to use jQuery to change the src attribute of an image element. To change the src of the img element, use this jQuery code: ("my-img ").attr("src", "www.new-url.com/images/my-img.png") How to change or alter img src with jQuery. completeA function to call once the animation is complete.Above ("img") is my image tag element name. To get selected image id dynamically you have to use jQuery(this).attr("id")Note:please set your image path in src attribute, the image extension is .jpg. jQuery) This awesome code ( Slide pictures. Jquery. Change Style with Animation ) is write by psyvortex, you can se more from this user in the personal repository. You can find the original code on Codepen.io. This is how to change img src with jQuery, full code!11. I have this so far. com/jquery-1. .