jQuery   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了在touchmove上禁用jquery选择以启用页面上的滚动大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
如果您在任何移动设备(如iPad)上滚动时触摸选定的( https://harvesthq.github.io/chosen/)下拉式容器,菜单将弹出,您将无法滚动页面.

我尝试修改代码,通过注释掉两行并移动_this.container_mousedown(evt);像这样:

this.container.on('touchstart.chosen',(function(_this) {
                return function(evt) {
                    //_this.container_mousedown(evt);
                };
            })(this));
            this.container.on('touchend.chosen',(function(_this) {
                return function(evt) {
                    _this.container_mousedown(evt);
                    //_this.container_mouseup(evt);
                };
            })(this));

它可以滚动,但第一次触摸事件/点击不起作用.下拉只会闪烁.

解决方法

我只是通过评论解决

//_this.container_mousedown(evt);

在this.container.on(‘touchstart.chosen’ – 事件中.

无论如何,该动作都是由mousedown事件触发的.然这会导致打开时延迟300毫秒.

大佬总结

以上是大佬教程为你收集整理的在touchmove上禁用jquery选择以启用页面上的滚动全部内容,希望文章能够帮你解决在touchmove上禁用jquery选择以启用页面上的滚动所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。