This code fires at the same time jumping from 01 to 04 immediately. I'm trying to get it to fire the second if statement on the second .mouseover of that image, and fire the 3rd if statement on the 3rd .mouseover etc. Can't seem to figure it out.
if($('img[src*="01"]')){
$('img').mouseover(function () {
$(this).attr('src', function(i, src) {
return src.replace( '01', '02' );
});
})
}
if($('img[src*="02"]')){
$('img').mouseover(function () {
$(this).attr('src', function(i, src) {
return src.replace( '02', '03' );
});
});
}
if($('img[src*="03"]')){
$('img').mouseover(function () {
$(this).attr('src', function(i, src) {
return src.replace( '03', '04' );
});
});
}