I have a div, inside which I'm using as a slide show. It all works fine but when the page is scrolled so the slideshow isn't in view, and the fadeIn animation happens then the page auto scrolls to show the animation. Is there anyway to stop this?
I'm really newbie with javascript :(
window.setInterval(function(){
if(fader < <?php echo count($homePageFavs);?>) {//it's not the last image so we can move right
var newFade = fader;
newFade++;
$(".fader_"+fader).fadeOut( "slow", function() {
// Animation complete.
$(".fader_"+newFade).fadeIn( "slow", function() {
// Animation complete
});
});
fader = newFade;
} else { // loop back to the first one
$(".fader_"+fader).fadeOut( "slow", function() {
// Animation complete.
$(".fader_1").fadeIn( "slow", function() {
// Animation complete
});
});
fader = 1;
}
}, 10000);