I have the following jquery. What i am trying to do is when i scroll down my page pass 900px a div slides out from the left and when i scroll up pass 900px it slides left out of view. right now if slides out when i am at the bottom of the page and if i scroll back up it does not slide in. i just cant figure what i am doing wrong. i would really appreciate some direction.
$(window).scroll(function() {
var content = $(window).scrollTop();
if (content < 950){
$('.float-menu').animate({left: '-100px'},800);
} else {
if (content > 950) {
$('.float-menu').animate({left: '0px'},500);
}
}
});
Aucun commentaire:
Enregistrer un commentaire