小编sup*_*nke的帖子

在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));
Run Code Online (Sandbox Code Playgroud)

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

jquery jquery-chosen

4
推荐指数
1
解决办法
144
查看次数

标签 统计

jquery ×1

jquery-chosen ×1