avalon icon indicating copy to clipboard operation
avalon copied to clipboard

avalon mobile中的触屏事件问题

Open Canyun opened this issue 11 years ago • 7 comments

下面的代码在触控设备的环境中swipe事件会导致click事件不生效,只有swipe事件有效,pc上表现正常。

<script>
    avalon.config({
        loader: false
    });
    avalon.define("touch", function (vm) {
        vm.click = function (e) {
            console.log("你好!");
        }
        vm.clickChild = function (e) {
            console.log("你不好");
        }
    });

</script>
<body ms-controller="touch">
<div id="screen" style="background-color: #cccccc;width: 80%;height: 300px;" ms-on-swipeleft="click">

    <div style="background-color: red; width: 200px;height: 300px;" ms-on-click="clickChild"></div>

</div>
</body>

Canyun avatar Mar 17 '15 05:03 Canyun

请说明是什么设备,什么浏览器

RubyLouvre avatar Mar 17 '15 06:03 RubyLouvre

我也遇到了同样的问题,只要父元素绑定了swipe*事件,子元素绑定的tap事件就不能被触发,测试环境: 1.chrome 版本 40.0.2214.93 m 自带的手机模拟器 2.iphone 5s Safari

weeksun23 avatar Mar 18 '15 08:03 weeksun23

swipe后应该不会触发click吧

RubyLouvre avatar Mar 18 '15 08:03 RubyLouvre

swipe后是不会触发click,但我click子元素的时候都没有触发所绑定的click事件

weeksun23 avatar Mar 18 '15 08:03 weeksun23

是在chrome环境下,设备就是一般的触摸设备。

Canyun avatar Mar 20 '15 01:03 Canyun

求解决。。。

weeksun23 avatar Mar 24 '15 12:03 weeksun23

已解决

ShirlyFE avatar Mar 27 '15 08:03 ShirlyFE