KingSora / OverlayScrollbars

A javascript scrollbar plugin that hides the native scrollbars, provides custom styleable overlay scrollbars, and preserves the native functionality and feel.
https://kingsora.github.io/OverlayScrollbars
MIT License
3.9k stars 215 forks source link

How to hide scrollbars on print? #628

Closed dannybeckett closed 7 months ago

dannybeckett commented 7 months ago

Describe the bug I am trying to hide the scrollbars from my print stylesheet like so:

@media print {
    div.os-scrollbar,
    ::-webkit-scrollbar
    {
        display: none !important;
    }
}

To Reproduce This works the first time you hit Print, but the 2nd time you hit Print it shows the scrollbar slightly, and by the 3rd time you hit Print the scrollbar is fully showing again.

Expected behavior Scrollbar should not show when the page is printed, no matter how many times you press Print

Environment

Additional context

Thanks a lot! 😃

KingSora commented 7 months ago

Good day @dannybeckett

I've published v2.7.3 which should hide the scrollbars when printing. I hope it works :)

dannybeckett commented 7 months ago

@KingSora Beautiful work!! I am once again very impressed - thank you so much! 🎉

KingSora commented 7 months ago

Glad I could help! :)