dollar-touch

the touch from dollar

Usage no npm install needed!

<script type="module">
  import dollarTouch from 'https://cdn.skypack.dev/dollar-touch';
</script>

README

dollar-touch


dollar-touch

新增模块,提供tap事件,用于解决移动端click事件300ms延迟以及点透等问题。

相比Zeptotap事件,dollar里面的tap事件会阻止原生的click事件防止点透的发生,同时会根据点击的元素去触发对应的默认事件,比如label,input等元素。

用法和原生事件一样:


var $ = require(dollar-touch’);

$(‘body’).on(‘tap’, function(){});

$(‘body’).tap(function(){});