I'd like to detect when a user has stopped scrolling a page/element.(我想检测用户何时停止滚动页面/元素。)
This may be tricky as recently enhancements to OSX's scrolling behaviour creates this new inertia effect.(这可能是棘手的,因为最近OSX滚动行为的增强产生了这种新的惯性效果。) Is there an event fired?(是否有事件被触发?)
The only other solution I can think of is using a interval to pick up when the scroll position of a page/element no longer changes, for example:(我能想到的唯一其他解决方案是,当页面/元素的滚动位置不再更改时,使用间隔进行拾取,例如:)
var element = $( el );
var previous = element.scrollLeft();
var current;
element.scroll( function(event)
{
current = element.scrollLeft();
if ( current === previous )
{
// user has stopped scrolling
}
previous = current;
});
ask by Ahmed Nuaman translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…