views:

58

answers:

4

how to disable the scroll bars of the page.

and disable this button.

alt text

+2  A: 

You can't disable that button (or any other method of scrolling the page); see this. However, you could scrollTo(0,0) anytime you detect scrolling. This might look ugly (page scrolls a bit, then jumps back up).

For disabling the scrollbars, you can try setting html, body { overflow: hidden }; I think some browsers may not honor this.

(Wouldn't it be better to just create a page that fits into the viewport, so that the scrollbars aren't shown?)

Piskvor
+1  A: 

The scrollbars are a CSS issue. You can add this to your page (or the inner part to a CSS file):

<style type="text/css">
html, body {
  overflow: hidden;
}
</style>
palswim
A: 
document.body.scroll = "no";
document.body.style.overflow = 'hidden';
document.height = window.innerHeight;

should disable the scrollbars in most browsers.

See: http://www.eggheadcafe.com/community/aspnet/3/10088543/how-to-disable-document-body-from-scrolling.aspx

Adam
it doesn't work ?
faressoft
@faresoft you still see a scrollbar despite trying each of those?
Adam
A: 
$(window).scroll(function() {
    scroll(0,0);
});
faressoft
So, this is jQuery? You might want to add that as a tag.
palswim