I try to use best solution for bootstrap custom scroll-bar but so far nothing special:|
I want to be able to replace default browser scroll-bar on body and inside on other elements like panels or wells, textarea ...
I found this plugin and woks just fine but if I want to replace body scroll is not working as in other cases.
Am I not doing something right or ... can someone explain me why is not working for <body>
or if can just suggest me other plugins except: jQuery slimScroll, malihu-custom-scrollbar-plugin, jScrollPane
because I already tested and aren't good for my project.
Here is a small fiddle example
ty
Bootstrap 4.3 added new built-in scroll feature to modals. This makes only the modal-body content scroll if the size of the content would otherwise make the page scroll. To use it, just add the class modal-dialog-scrollable to the same div that has the modal-dialog class.
Add data-spy="scroll" to the element that should be used as the scrollable area (often this is the <body> element). Then add the data-target attribute with a value of the id or the class name of the navigation bar ( . navbar ). This is to make sure that the navbar is connected with the scrollable area.
Use the . modal-dialog-scrollable class to enable scrolling inside the modal.
Ok, I see what you mean now - looks to me like you can't really use this javascript scroll solution on the <body>
tag as it gets confused by the hidden parts of the other scrolled elements.
I would suggest wrapping everything in a <div id=bodyDiv>
, styling it to use only the available window space and then adding the scrollbar to that to simulate the scroll being on <body>
:
http://jsfiddle.net/W4JKM/
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