I need some simple JQuery code so I can change the src value of a specific img.
It\'s currently:
<
Using: $(function(){ ... });
You can use:
$('#id').attr('src', 'newImage.jpg');
to change the image source immediately.
Alternatively, you can use jQuery animations to change an image.
JS
$("#id1").fadeOut();
$("#id2").delay(200).fadeIn();
HTML
(Don't forget to change the CSS of #id2
and put display: none
as initial state).