Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to DISABLE scrollbar in webpage? (not HIDE scrollbar)

Tags:

html

css

using:

$('body,html').css("overflow","hidden");

the scrollbar in the page was able to hide completely. But i want the scroll bar just to be DISABLED during some AJAX event. Later using:

$('body,html').css("overflow","visible");

I had to enable scrolling again for full page in my AJAX success.

(Like removing scrollbox from scorllbar and disabling scrolling arrows) yet still scrollbar appears in th window. This would prevent from change of page width in meantime.

Is there any possibilitioes to do so? Any help is appriciated. Thanks in advance.

like image 233
ram Avatar asked Sep 17 '13 12:09

ram


People also ask

How do I stop my scroll bar from hiding?

Click on Start > Ease of Access. Scroll down on the left and Check or uncheck Automatically hide scroll bars in Windows.

How do I make my scrollbar always visible?

Make sure overflow is set to "scroll" not "auto." With that said, in OS X Lion, overflow set to "scroll" behaves more like auto in that scrollbars will still only show when being used.

How do I restrict the scroll bar in HTML?

you can do: position: fixed; on the element you don't want to be scrollable.


1 Answers

OK here is the Working Code:

body
{
    position: fixed; 
    overflow-y: scroll;
    width: 100%;
}

I used it and its the same what you want.

like image 86
Hassan Sardar Avatar answered Oct 05 '22 05:10

Hassan Sardar