Answers for "How to prevent BODY from scrolling when a modal is opened Using jQuery ?"

4

javascript disable scrolling on body

document.body.style.overflow = 'hidden';
Posted by: Guest on August-17-2020
0

prevent body from scrolling when a modal is opened

$('#adminModal').modal().on('shown', function(){
    $('body').css('overflow', 'hidden');
}).on('hidden', function(){
    $('body').css('overflow', 'auto');
})
Posted by: Guest on August-04-2020

Code answers related to "How to prevent BODY from scrolling when a modal is opened Using jQuery ?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language