我正在尝试更改网页的默认滚动速度,数量和惯性。我谷歌了很多,但徒劳无功
幸运的是,今天晚些时候,我发现了一个插件,它允许我们只在特定的 div 标签内而不是在整个网页中更改滚动速度、数量、惯性。
这是一个基本代码
$(".I-WILL-APPLY-ONLY HERE").mCustomScrollbar({
set_width:false,
set_height:false,
horizontalScroll:false,
scrollInertia:550,
SCROLLINERTIA:"easeOutCirc",
mouseWheel:"auto",
autoDraggerLength:true,
scrollButtons:{
enable:false,
scrollType:"continuous",
SCROLLSPEED:20,
SCROLLAMOUNT:40
},
advanced:{
updateOnBrowserResize:true,
updateOnContentResize:false,
autoExpandHorizontalScroll:false,
autoScrollOnFocus:true
},
callbacks:{
onScrollStart:function(){},
onScroll:function(){},
onTotalScroll:function(){},
onTotalScrollBack:function(){},
onTotalScrollOffset:0,
whileScrolling:false,
whileScrollingInterval:30
}
});
<div id="I-WILL-APPLY-ONLY HERE" class="I-WILL-APPLY-ONLY HERE">
A basic height in pixels would be defined for this element and any content appearing here will have a different scrollspeed,inertia.Mentioning heignt of this div element is compulsary,else i wont show the output </div>
问题是我想要整个页面,而不仅仅是特定的 div 元素。任何帮助将不胜感激。请帮助我
提前致谢