0

Does anyone encounter the problem that when setup "scrollButtons: { scrollType: "stepped"} buttons doesn't work on touch devices? code:

$("container").mCustomScrollbar({
    setHeight: false,
    autoExpandScrollbar:true,
    snapAmount: height,
    mouseWheel: {
        enable: false,
        scrollAmount: height,
        normalizeDelta:true
    },
    keyboard: {
        enable: false,
        scrollAmount: height
    },
    scrollButtons: {
        enable: true,
        scrollAmount: 1,
        scrollType: "stepped"
    },
    advanced: {
        updateOnContentResize: true
    },
    scrollInertia: 1,
    contentTouchScroll: 10000,
    documentTouchScroll: false
});
WEBCENTER
  • 143
  • 4
  • 14

1 Answers1

-1

You can use this code

<!-- custom scrollbar script -->
<script src="/path/to/jquery.mCustomScrollbar.js"></script>
<!-- detect mobile script -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.3.5/mobile-detect.min.js"></script>
<!-- custom scrollbar function call -->
<script>
    (function($){
        var md=new MobileDetect(window.navigator.userAgent); //get device type
        $(window).load(function(){
            if(!md.mobile()){ //apply custom scrollbar if device is not mobile
                $(selector).mCustomScrollbar();
            }
        });
    })(jQuery);
</script>
Jinesh
  • 1,554
  • 10
  • 15