jQuery Custom Scrollbar Plugin
Add-ons

Plugin description: A jQuery custom scrollbar plugin that supports horizontal and vertical scrolling on mobile devices, as well as mouse wheel scrolling.
Last updated: 2021-03-07 22:40:47
Usage
1. Include JS
1 2 | <script type="text/javascript" src="js/jquery.nicescroll.js"></script> |
2、html
1 2 3 4 5 6 7 8 9 10 11 12 | <div class="content longitudinal"> <ul> <li>jQuery is a fast and concise JavaScript framework</li> <li>The core features of jQuery can be summarized as follows</li> <li>It features a unique chainable syntax and a concise, clear, multifunctional interface</li> <li>It features efficient and flexible CSS selectors</li> <li>It also allows CSS selectors to be extended</li> <li>It provides a convenient plugin extension mechanism and a rich collection of plugins</li> <li>jQuery is compatible with all major browsers</li> <li>It encapsulates commonly used JavaScript functions</li> </ul></div> |
3. Configure page JS
1 2 3 4 5 6 7 8 9 | $('.longitudinal').niceScroll({ cursorcolor: "#ccc", //#CC0071 Cursor color cursoropacitymax: 1, // Change the opacity when the cursor is active (scrollbar "visible" state), ranging from 1 to 0 touchbehavior: false, // Makes dragging the scrollbar feel like using a touch device on a desktop computer cursorwidth: "5px", // Cursor width in pixels cursorborder: "0", // Cursor border CSS definition cursorborderradius: "5px", // Cursor border radius in pixels autohidemode: false // Whether to hide the scrollbar}); |
评论