【发布时间】:2013-01-03 19:03:23
【问题描述】:
我正在尝试更改网页的默认滚动速度,数量和惯性。我google了很多,但没有成功
幸运的是,今天,我找到了a plugin,它允许我们仅在特定的 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 元素。任何帮助将不胜感激。请帮助我
提前致谢
【问题讨论】:
-
“数量和惯性”是什么意思
-
在这里尝试滚动,manos.malihu.gr/tuts/custom-scrollbar-plugin/… 这是惯性。 Scrollamount 是每次滚动时滚动的数量/%/像素。滚动量越多,滚动越多(滚动量和滚动速度之间存在细线差异)
-
我真的无法解释,惯性到底是什么意思,........这里有一个例子loisjeans.com/web2012/es当你滚动时,页面滚动,元素向上移动并缓慢停止。
标签: jquery html jquery-ui jquery-plugins