大佬教程收集整理的这篇文章主要介绍了jquery – 如何检查元素当前是否正在拖动,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
所以我的问题是如何执行“if”语句检查当前是否正在拖动滚动条,以便我可以阻止它执行函数代码的其余部分?
我不是在问一个元素是否有一个“绑定”的事件,而是在某个特定时刻触发该事件.
我可以这样做吗?或者我需要采取另一种方法?
这是我的代码的样子:
$('.container').scroll(function(){ //get the heights of the container and it's contents and the difference //get the height of the scroll bar and it's container and the difference //declare the top property of scroll bar from this info }); function scrolly() { //get the heights of the elements described above //declare the scrollTop of the container } $('.bar').draggable({ axis: 'y',containment: 'parent',drag: function() { scrolly(); } });
以上是大佬教程为你收集整理的jquery – 如何检查元素当前是否正在拖动全部内容,希望文章能够帮你解决jquery – 如何检查元素当前是否正在拖动所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。