tapHold

触屏上的常按事件

定义

当常按某个 dom 节点超过 1s 后触发

示例

<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <script src="//g.alicdn.com/kissy/k/1.4.7/seed.js" data-config="{combine:true}"></script>
</head>
<body>

<h1>open in ios safari to test tap event</h1>

<div id='t' tabindex='0'
     style='border:1px solid green;
     width:100px;height:100px;margin:10px'>
    tap-hold me
</div>

<script>

    KISSY.use('event', function (S, Event) {

        Event.on('#t', "tapHold", function (e) {
            alert(e.type + ' : fired');
        });

    });

</script>
</body>
</html>