-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hammer.html
31 lines (29 loc) · 986 Bytes
/
Hammer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!doctype html>
<html>
<head>
<style type="text/css" media="all">
.box {
height: 200px;
display: block;
background: #444;
}
</style>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hammer js Tutorial</title>
</head>
<body>
<h3>Hammer js Tutorial</h3>
<div id="box" class="box">fghhj</div>
<script src="hammer.min.js"></script>
<script type="text/javascript" charset="utf-8">
const box = document.getElementById("box");
console.log(box);
const hammr = new Hammer(box);
hammr.on("swipeleft", function (e) {
console.log(e.target.clientWidth);
console.log(e.target.clientHeight);
});
</script>
</body>
</html>