noeldelgado / gemini-scrollbar

:first_quarter_moon: Custom overlay-scrollbars with native scrolling mechanism for web applications
https://noeldelgado.github.io/gemini-scrollbar/
MIT License
429 stars 63 forks source link

design fix #36

Open desislavsd opened 7 years ago

desislavsd commented 7 years ago

Hi, I really like the way your plugin works!

However, zooming in/out the screen will reveal the native scrollbars. They are also visible before the plugin is applied, which is not a problem on initial load of the page, but when i dynamically add new elements.

I think this small improvement will do the job. It will be better if the .gm-scroll-view is absolutely positioned and has no fixed width and height. Let the developer set the width and the height of the wrapper (for example 100%/100%) and the .gm-scroll-view should be stretched with left: 0; top: 0; right: -[nativeScrollbarWidth]; bottom: -[nativeScrollbarWidth];, where the given css should be appended to the body the first time the plugin is used, since it needs to calculate the nativeScrollbarWidth. This way you will not have to resize the view every time the wrapper is resized, or for the sequential dynamically added elements, since the css will take care of that. In fact you did this with the scrollbars.

If something is not clear you may find similar approach with nanoScroller.js. But I prefer your plugin and i hope you will find my suggestion useful!

Best