Starx Starx - 2 years ago 130
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.

Answer Source

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; }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download