Disable scrolling browser window of any type?

Is there a way to disable scrolling? Not only the scroll bar, but all the functionality from the browser window?

+4
source share
3 answers

based on your answer to Keit that you don’t want to scroll, are active when you have a lightbox open? if so, you can add a class to the body at the same time as opening the lightbox with the following css

And the good thing about this solution is keeping the β€œspace” scroll, so the site doesn’t jump, it looks more like turning it off. hope this helps

body.noscroll { position: fixed; overflow-y: scroll; width: 100%; } $('body').addClass('noscroll'); $('body').removeClass('noscroll'); 
+22
source

CSS

 body { overflow: hidden; } 

Javascript

 document.body.style.overflow = "hidden"; 

JQuery

 $("body").css('overflow', 'hidden'); 
+9
source

If your GWT application is located on your web page, you can use:

 import com.google.gwt.user.client.Window; // ... Window.enableScrolling(false); 

for example in your onModuleLoad function.

+3
source

Source: https://habr.com/ru/post/1414242/


All Articles