有没有人遇到设置"scrollButtons:{ scrollType:"stepped"}按钮在触控设备上不起作用的问题?代码:
$("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
});发布于 2017-10-28 14:16:56
您可以使用以下代码
<!-- 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>https://stackoverflow.com/questions/46975060
复制相似问题