-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
52 lines (50 loc) · 1.1 KB
/
index.html
File metadata and controls
52 lines (50 loc) · 1.1 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box {
position: fixed;
top: 10px;
left: 100px;
width: 150px;
height: 150px;
background-color: red;
z-index: 100;
touch-action: none;
}
p {
font-size: 25px;
position: fixed;
top: 200px;
color: rgb(132, 132, 250);
}
span {
font-size: 30px;
color: blue;
}
</style>
</head>
<body>
<div class="box"></div>
<p>touchmove count :<span>1</span></p>
<ul></ul>
<script>
let count = 0;
const box = document.querySelector('.box');
box.addEventListener('touchmove',(e)=> {
e.preventDefault();
count ++;
document.querySelector('p > span').textContent = count;
})
for(let i = 0; i < 300; i++){
const li = document.createElement('li');
li.textContent = i;
document.querySelector('ul').appendChild(li);
}
</script>
</body>
</html>