Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE10 stop scroll bar from appearing over content and disappearing

If you go to any website with content that causes a vertical scroll bar in ie10 (desktop) such as http://www.buildwindows.com/ you'll notice that the scroll bar only appears when you hover over the window.

Is there anyway of forcing the scroll bar to always display? I'm worried that it makes it less obvious that there is more content further down the page.

Thanks

like image 454
user1010892 Avatar asked May 30 '13 08:05

user1010892


People also ask

How do I stop the scroll bar from disappearing?

Go to Settings / Ease of Access / Display and turn off Automatically hide scroll bars in Windows. Scroll bars will then always be full-size in many (but not all) places.

How do I turn off the overflow auto scroll bar?

To hide the vertical scrollbar and prevent vertical scrolling, use overflow-y: hidden like so: HTML.

Why is overflow scroll 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. So if any the solutions above don't appear to be working that might be why. You can style it accordingly if you don't like the default.

Why does scroll bar keep disappearing?

Browser Magnification. Using your browser's magnification or zoom controls may cause scroll bars to disappear. Observe this phenomenon by opening a Web page and pressing "Ctrl-<minus symbol>" repeatedly. Your actions cause the page's content to shrink in size.


2 Answers

There is a custom vendor-prefixed CSS property to set:

html {    -ms-overflow-style: scrollbar; } 

Other options include auto, none, scrollbar, and -ms-autohiding-scrollbar. The latter causes the behavior you're experiencing.

An excerpt from the MSDN documentation, specifically the abovementioned scrollbar value:

Indicates the element displays a classic scrollbar-type control when its content overflows.

Unlike -ms-autohiding-scrollbar, scrollbars on elements with the -ms-overflow-style property set to scrollbar always appear on the screen and do not fade out when the element is inactive.

like image 65
Pedro Lopes Avatar answered Sep 24 '22 06:09

Pedro Lopes


This should do the trick, the media query will prevent the scroll for disappearing when screen is larger than 992px. (I assume Windows mobile device need this for hiding the scroll bar. this is why I've made the media query).

@-ms-viewport {   width: device-width;   } @media (min-width: 992px) {   @-ms-viewport {     width: auto !important;   } } 
like image 32
Cstyves Avatar answered Sep 21 '22 06:09

Cstyves