Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tab内容中,zepto注册的longTap失效 #25

Open
zlzdp opened this issue Apr 30, 2015 · 5 comments
Open

tab内容中,zepto注册的longTap失效 #25

zlzdp opened this issue Apr 30, 2015 · 5 comments

Comments

@zlzdp
Copy link

zlzdp commented Apr 30, 2015

              <div class="box-flex long-press-demo">
                    <span class="box-flex-item">
                        <label>姓名</label>
                        <p>
                            张三
                        </p>
                    </span>
                    <span class="box-flex-item">
                        <label>出生年月日</label>
                        <p>
                            2015年4月28日
                        </p>
                    </span>
                </div>

$('.long-press-demo').on('longTap','.box-flex-item',function (e) {
alert(this.outerHTML)
console.log(e.type)
})

使用以下的tab组件后,导致longTap事件不响应。
var tab = new fz.Scroll('.ui-tab', {
// role: 'tab',
// // interval: 3000
// //autoplay: true
// });

@zlzdp
Copy link
Author

zlzdp commented Apr 30, 2015

使用了tap后 ,longTap长按,浏览器响应的是点击鼠标右键的效果。
注释掉frozenjs 的 new tab的代码,longTap就可以正常触发。

@hkz404
Copy link
Contributor

hkz404 commented May 11, 2015

由于实现机制的缘故,tab 组件默认屏蔽了所有事件,其中 click 和 tab 都是模拟出来的。针对你这种场景可能无法支持~

@zlzdp
Copy link
Author

zlzdp commented May 12, 2015

我改了你们的源码,是否阻止事件 我做成了一个配置项,避免那种问题。

@zlzdp
Copy link
Author

zlzdp commented May 12, 2015

不过你们重写了zepto的tap,却好像没去管longTap,是否应该把longTap也重写一下?
不然longTap就有问题,现在的轻轻的一点击,longTap事件也触发。

@hkz404
Copy link
Contributor

hkz404 commented May 12, 2015

@jeakey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants