Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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');
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #prevent #body #scrolling #modal #opened
ADD COMMENT
Topic
Name
6+3 =