I am developing a plugin on wordpress (currently using Twenty Thirteen theme) that when you click a div a modal will show. Whenever the modal is showing I want to remove the scrollbar on body.
I used the code below but it seems it doesn't work:
jQuery("#page").css("overflow", "hidden");
jQuery('body').css('overflow','hidden');
I can see style="overflow: hidden;" on firebug is being added but the scrollbar is still showing.
I also tried using !IMPORTANT like jQuery('body').css('overflow','hidden!IMPORTANT'); but still not working
I hope someone can help me with this.
Thanks!
jQuery('body').css({
'overflow': 'hidden'
'height' : $( window ).height()
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With