-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojltr.js
More file actions
26 lines (25 loc) · 739 Bytes
/
projltr.js
File metadata and controls
26 lines (25 loc) · 739 Bytes
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
let tchi =false;
let stX =0;
const swd = window.innerWidth;
document.addEventListener('touchstart', function(event) {
const touch = event.touches[0];
tchi = true;
document.getElementById("u22").style.color="red";
stX = touch.clientX;});
document.addEventListener('touchmove', function(event) {
if (tchi){
const touch = event.touches[0];
const dmd = touch.clientX - stX;
if (stX < swd / 4 && dmd > swd / 4) {
location.href="micropro.html";
tchi = false;
}
if (stX >= swd /4 && dmd < -swd /4) {
location.href="news.html";
tchi = false;
}
}});
document.addEventListener('touchend', function() {
tchi = false;
document.getElementById("u22").style.color="white";
});