是否有可能创建一个jQuery事件触发时滚动条释放? [英] Is it possible to create a jQuery event that triggers when a scrollbar is released?

查看:98
本文介绍了是否有可能创建一个jQuery事件触发时滚动条释放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何创建一个jQuery事件,如果使用鼠标滚动时滚动标记(当使用键盘滚动时)会触发滚动标记。

I would like to know how would one go about creating a jQuery event that would trigger when a scroll marker is released if scrolling with mouse (and also when scrolling with keyboard).

当搜索互联网时,我发现了一个特殊的scrollstop事件这里在滚动停止时触发,但是包括当滚动条仍然被保持时的情况。可以将事件以某种方式组合起来,所以让我们说滚动事件只有当鼠标被释放时才触发?

When searching the Internet I have found a special scrollstop event here that triggers when scrolling stops, but that includes the case when scrollbar is still being held. Can events somehow be combined, so let's say scrollstop event only triggers when mouse is released also?

推荐答案

不,你不能这样的事情。原因是您只能捕获页面上的点击事件。滚动条是浏览器的一部分,而不是页面。浏览器只会为您触发滚动事件。另一点不是将自己限制在台式电脑上。网页应该在移动浏览器上正常工作。其中一些根本没有滚动条。他们可以触发滚动事件,但单击滚动条上的事件将是无用的。

No you can't do such a thing. The reason is that you can only catch click events on the page. The scrollbar is part of the browser not the page. Only the scroll event is triggered for you by the browser. The other point is not to limit yourself to desktop computers. Webpages should work fine on mobile browsers. Some of them don't have scrollbars at all. They can trigger scroll event, but click events on a scrollbar would be useless.

您的解决方案是以不同的方式思考。您可能需要重新考虑您的真实情况。

The solution for you is to think differently. You may need to reconsider what you're really up to.


我们无法通过使用
来解决问题我们在
创建它们时使用的一种想法。

"We can't solve problems by using the same kind of thinking we used when we created them."

爱因斯坦爱伯恩

这篇关于是否有可能创建一个jQuery事件触发时滚动条释放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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