Like when you press the button to scrolling pages?

Have the code open the modal window by clicking on the button. How to make so that when pressing, it was not possible to scroll outside the window?
$(".close-modal").on('click', function(e){

 var $this = $(this),
 modal = $($this).data("modal");

 setTimeout( function(){ 
 }, 350);

April 7th 20 at 10:41
1 answer
April 7th 20 at 10:43

.modal-open {
 overflow: hidden;
why doesn't it?
I want to remove scrolling from the body, not only in the

.body-freeze {
overflow: hidden;
} - Cale12 commented on April 7th 20 at 10:46

Find more questions by tags jQuery