Priyanka Pachori Priyanka Pachori - 2 months ago 16
HTML Question

Disable a nicescroll scroll bar, which is coming by default

I am getting a nicescroll scroll bar ( red colour), by default, which is causing my html page to break when Zooming in.How to disable it.

Answer

The key horizrailenabled value is globally set to true, in the _globalobjects object. You can set the value to false which will disable the Nicescroll functionality, leaving the native scroll in place.

This recommendation is directly from Nicescroll Issues Resolution

$("#yourscrollableelement").niceScroll({horizrailenabled:false});

To disable the native scroll with quoted key add this line:

$("#yourscrollableelement").css({"overflowX":"hidden"});

Though this is a solution, I would recommend viewing the Nicescroll code to determine what is causing issues with your mark-up. Often times, you can solve the issue by adjusting your code.

If you pull the nicescroll.js file into your editor, search/find HORIZ. This will most likely be where the conflict is occurring. My guess, the variable cursor css property position: absolute; is the culprit. Then you can adjust your styling and maintain functional integrity with the Nicescroll library.

Comments