How to add multiple if or else inside window scroll function? You can see the example below.
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll <= 650) {
$j('.innerimage').attr('src', 'images/side_1.png');
}
if (scroll >= 850) {
$j('.innerimage').attr('src', 'images/side_2.png');
}
});
Aucun commentaire:
Enregistrer un commentaire