Disable scrolling in HTML5

I would like to disable all forms of page scrolling in my application HTML5. I tried to find SO and Google for a common answer to prevent all scrolling mechanisms, but everything is very specific - for example, how to turn off scrolling with touches or arrow keys or scroll bars themselves.

The reason I'm looking for this is to create a new one divunder the visible screen and animate it (and down). MoonBase shows what I mean.), And I don't want the user to be able to scroll down to see it. Is it possible? Is there a tag metathat I can install? Or CSS? “Or am I mistaken in my animation?” That is, all my problems will be fixed if I just animated them from the side (and included the tag meta width=device-width)? Is this the closest way for me to get the desired behavior?

+5
source share
1 answer

You do not need JavaScript, just use CSS. Install overflow: hidden;:

body {
    overflow: hidden;
}
+21
source

All Articles