I am opening a popop windows with window.open. I want the scrollbars to show up if needed. However in safari, the scrollbars are not showing up unless I set, scrollbars=1,
However that makes even horizontal scrollbars show up. Is there a way to specify,
"Show only horizontal scrollbars, if needed" to popop window.
(Possibly via some combinations of options to window.open, and overflow, css property.)
There are two types of scroll bars: vertical and horizontal.
Show scroll bars in Word and Excel for WindowsClick File > Options. On the Advanced tab, scroll to the Display section. Select Show horizontal scroll bar and Show vertical scroll bar, and then click OK.
You're basically getting a double scrollbar because your giving the body min-height of 100vh AND setting an overflow. It appears this was done to keep the menu in the correct position on mobile devices. That fixed things in Chrome, I assume other browsers as well but I didn't do any heavy testing.
For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.
I've been messing with this a little and I settled on this solution until I find a better one:
window.open('http://yoursite.com','mypopup',
'status=1,width=500,height=500,scrollbars=1');
Then in the CSS of yoursite.com, put this:
html {
overflow-x: hidden;
overflow-y: auto;
}
In some browsers, a vertical scrollbar may show even if the content fits in the window. But the horizontal scroll bar should not show.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With