如何检测滚动条上的mouseup? (或“scrollEnd”事件) [英] How to detect mouseup on a scrollbar? (or "scrollEnd" event)

查看:106
本文介绍了如何检测滚动条上的mouseup? (或“scrollEnd”事件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道如何在滚动条上检测mouseup事件?它适用于FF,但不适用于Chrome或IE9。

Anyone have any idea how to detect a mouseup event on a scrollbar? It works in FF, but not in Chrome or IE9.

我设置了一个快速演示: http://jsfiddle.net/2EE3P/

I set up a quick demo: http://jsfiddle.net/2EE3P/

总的想法是我要检测 scrollEnd 事件。显然没有这样的事情,所以我使用 mouseUp 和计时器的组合,但 mouseUp 没有解雇在大多数浏览器! div包含一个项目网格,因此当用户停止滚动时,我想将滚动位置调整到最近的有意义的点,例如最近的细胞的边缘。但是,如果它们处于滚动状态,我不想自动调整位置。

The overall idea is that I want to detect a scrollEnd event. There is obviously no such thing so I was going with a combination of mouseUp and timers, but mouseUp isn't firing in most browsers! The div contains a grid of items so when the user stops scrolling I want to adjust the scroll position to the nearest point that makes sense, e.g. the edge of the nearest cell. I don't, however, want to automatically adjust the position if they're in the middle of scrolling.

我也很乐意接受任何给我的答案相当于 scrollEnd

I'll also happily accept any answer that gives me the equivalent of scrollEnd

推荐答案

回答我自己的问题所以我可以关闭它 - 没有好的解决方案,所以定时器就是......

Answering my own question so I can close it -- there is no good solution to this, so timers it is...

这篇关于如何检测滚动条上的mouseup? (或“scrollEnd”事件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆