首页 > 代码库 > hammer.js (demo)
hammer.js (demo)
<!DOCTYPE html><html><head><meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"><script src="./hammer.js"></script><style> .hitarea{width:300px;height:300px;background-color:red;}</style></head><body><div id="hitarea" class="hitarea"></div><script> var container= document.getElementById("hitarea"); hammertime = Hammer(container, { preventDefault: true, gesture: true }) hammertime.on("swipeleft", function(){ alert("swipeleft"); }); hammertime.on("swiperight", function(){ alert("swiperight"); }); /* touch release gesture hold tap doubletap dragstart drag dragend dragleft dragright dragup dragdown swipe swipeleft swiperight swipeup swipedown transformstart transform transformend rotate pinch pinchin pinchout */</script></body></html>
hammer.js点击这里下载
hammer.js (demo)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。