Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling browser scrollbar

Hi Is it possible to disable browser scroll bar through java script...? If yes how?

Help me if anybody knows it... Thanks in advance..

like image 597
Nithesh Narayanan Avatar asked Dec 03 '10 05:12

Nithesh Narayanan


People also ask

How do I disable scrollbar in Chrome?

2. Type "Remove Scrollbars" (without quotes) in the search box and press "Enter." Click the "Remove Scrollbars" option located on top of the search results.

How do I get rid of the vertical scroll bar?

Click Options, and then click the Advanced category. Under Display options for this workbook, clear or select the Show horizontal scroll bar check box and Show vertical scroll bar check box to hide or display the scroll bars.

How do I disable body scroll?

The most straightforward way for disabling scrolling on websites is to add overflow: hidden on the <body> tag.


2 Answers

CSS

body
{
    overflow: hidden;
}

javascript

document.body.style.overflow = "hidden";

jQuery

$("body").css('overflow', 'hidden');
like image 132
rahul Avatar answered Oct 22 '22 03:10

rahul


Use this CSS

body {
   overflow:hidden;
}
like image 34
Chinmayee G Avatar answered Oct 22 '22 02:10

Chinmayee G