I have written a jQuery function to toggle between overflow-y: hidden, and, overflow-y: auto upon pressing a button. This works great on Chrome, Opera and Firefox on desktops. But for some reason Microsoft Edge does not work which is rather strange since the rest of the browsers all worked without problem. Some help and explanation would be wonderful!
$(".pro-toggle").click(function(){
var hidden = $('body').css('overflow');
if(hidden == 'hidden'){
$("body").css("overflow-y","auto");
}
else {
$("body").css("overflow","hidden");
}
});
<button class="navbar-toggle collapsed pro-toggle pull-left" data-toggle="collapse">
<span class="icon-bar top-bar"></span>
<span class="icon-bar middle-bar"></span>
<span class="icon-bar bottom-bar"></span>
</button>