I am trying to make an image change once you scroll to a certain point. I've tried the following but it changes right when you scroll.
jQuery(function($) {
$(window).scroll(function() {
if($('.navbar').hasClass('navbar-brand')) {
$('.navbar .navbar-brand img').attr('src','http://placehold.it/120?text=Original+Logo!');
}else{
$('.navbar .navbar-brand img').attr('src','http://placehold.it/120?text=Original+Logo!');
}
});
});
I tried to add the following code for it to know when to switch between images, but failed
var wn = $(window).scrollTop();
if(wn > 700){