tags:

views:

73

answers:

1

How to disable scrolling of body? $('body').css('overflow','hidden'); 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.

+2  A: 

Try this CSS, no jQuery needed for this:

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

[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; }
</style>
Makram Saleh
that only hides it, but scrolling occurs
Starx
You can always click+drag within the body, regardless of what you do with scrolling.
Diodeus
no it is not working, the scrolling still occurs
Starx