Starx Starx - 6 months ago 3x
Javascript Question

How to disable scrolling of body element?

How to disable scrolling of body?

only hides the scrollbars but it does not disable the scrolling. I want to disable the scrolling of the body.

But I want to keep the scrolling of other division intact.


Try this CSS, no jQuery needed for this:

<style type="text/css">
    html { overflow: hidden; }

[UPDATE after comment]

Try specifying the height of the body too:

<style type="text/css">
    html, body { overflow: hidden; height: 100% }
    body { margin:0; padding:0; }