Reputation: 19651
how to disable the scroll bars of the page.
and disable this button.
Upvotes: 9
Views: 54930
Reputation: 19651
$(window).scroll(function() {
scroll(0,0);
});
If you want to use it you need to have jQuery imported.
Upvotes: 6
Reputation: 21
This will remove your scroll bar. [I did it by accident]
@media screen{
body>div#header{
position:fixed;
}
body>div#footer{
position:fixed;
} `
Upvotes: 1
Reputation: 11
I am making a mobile website, but I don't want it to be a whole bunch of webpages, so I am making it one page with scrolling disabled. I did this with
<style>
html, body {
overflow: hidden;
}
</style>
Upvotes: 1
Reputation: 327
This works:
* {overflow: hidden}
One problem I have when figuring it out was that I have a CSS drop-down (well slide across) menu on the page and that doesn't show when I use this method. I am still trying to figure out how to get the drop-down to work with this enabled.
Upvotes: 0
Reputation: 12140
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>
Upvotes: 31
Reputation: 44929
document.body.scroll = "no";
document.body.style.overflow = 'hidden';
document.height = window.innerHeight;
should disable the scrollbars in most browsers.
Upvotes: 1
Reputation: 92752
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?)
Upvotes: 7