I\'d just like to hide an element on my page, after N number of pixels have been scrolled.
$(window).scroll(function(){
if($(document).scrollTop() > 200
It seems to work fine here: http://jsfiddle.net/maniator/yDVXY/
$(window).scroll(function() {
if ($(this).scrollTop() > 200) { //use `this`, not `document`
$('.fixedelement').css({
'display': 'none'
});
}
});
Try this.
$(window).scroll(function(){
if($(document).scrollTop() > 200){//Here 200 may be not be exactly 200px
$('.fixedelement').hide();
}
});