I have this code:
$(window).scroll(function() {
var y_scroll_pos = window.pageYOffset;
var scroll_pos_test = 200;
if(y_scroll_pos > scroll_pos_test) {
$('.extratext').slideDown('slow');
}
});
That works fine in FF, Chrome and IE 10 but not IE 9 or below. I have researched answers and they all say it should work with $(window)
instead of the usual $(document)
, which is what Ive got.
Does anyone know another way of amending this?
EDIT:
Added console.log(y_scroll_pos);
and it comes up with 'undefined'. Does IE not like window.pageYOffset;
?