What about people, all right? I have a JQuery scroll () event, but I'm having 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');
}
});
NOTE: I have also tried that browser similar to Chrome, -Chromium- and it also did not work ... I already changed the window by document and Nn worked