0
Hey, guys, what’s up? Guys, I have a little problem, I have a Jquery scroll() event, only I have a compatibility problem with Microsoft Edge (IE), follow the code:
$(window).scroll(function(){
var scrollTop = $('html, body').scrollTop();
if(scrollTop >= 40){
$('.header-menu').css('position', 'fixed');
$('.header-menu').css('top', '0');
$('.header-menu').css('left', '0');
$('.header-menu').css('right', '0');
}else if(scrollTop <= 40){
$('.header-menu').css('position', 'relative');
}
if(scrollTop >= 380){
$('.sub-menu').css('position', 'fixed');
$('.sub-menu').css('top', '140px');
$('.sub-menu').css('right', '40px');
}else if(scrollTop <= 500){
$('.sub-menu').css('position', 'absolute');
$('.sub-menu').css('top', '0');
}
});
OBS: I also tested in that browser similar to Chrome, -Chromium- and it also didn’t work... I also changed the window for Document and Nn worked
but what exactly didn’t work? gives some error?
– Ricardo Pontual
Ops, I just checked, the scroll event works, so the problem is in scrollTop.
– Breno Castro
if you want to see what I want to do, just go to http://ges.rf.gd for Chrome.
– Breno Castro