-
Notifications
You must be signed in to change notification settings - Fork 0
/
touch-action-pointer-events.html
58 lines (58 loc) · 3.32 KB
/
touch-action-pointer-events.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html>
<head>
<style>
/* html {
touch-action: auto;
pointer-events: none;
} */
#p1 {
/* touch-action: none; */
touch-action: auto;
}
/* #p2 {
touch-action: none;
} */
</style>
</head>
<body>
<p id='p1'>The above words, written by one of the greatest philosophers of olden time, have often impressed
me, and I have frequently quoted them when asked why I did not write an account of the interesting travels
and adventures I have had in my life. It has therefore required a great deal of courage to take up my
pen and record a few recollections of South Africa. I felt that, were they ever to be written at all,
it must be before the rapidly passing years diminish the interest in that land, which in the past has
been the object of such engrossing attention; and that at the present time, when the impending Federation
of South Africa has at length crowned the hopes of those patriots who have laboured patiently and hopefully
to bring about this great result, it might be appropriate to recall those days when Englishmen, who had
made South Africa their home, had much to contend with, even before the fierce struggle to keep "the flag
flying" in the years of 1899-1902.</p>
<p id='p2'>During that period, which commenced after the disaster at Majuba Hill, "equal rights" were a golden
dream which only the most optimistic ever hoped to see realized. From then onwards, as old colonists
have so often told me, the Boers brought up the younger generation in the belief that the "Roinek" was
a coward, and in consequence their arrogance in the country districts became wellnigh intolerable, while
at the Cape the Bond party grew so strong it bid fair to elbow out the English altogether. Now, while
the country is still young, the fair prospect opens out of Briton and Boer living in amity and peace
together, and mutually supplying, in the government of their vast inheritance, such elements as are wanting
in the character of each.</p>
<script>
const pAll = document.querySelectorAll('p');
for (const p of pAll) {
p.addEventListener('pointerdown', (event) => {
console.log(event.target.getAttribute('id') + ' pointerdown');
//event.target.setPointerCapture(event.pointerId);
//event.preventDefault();
});
p.addEventListener('pointermove', (event) => {
console.log(event.target.getAttribute('id') + ' pointermove');
});
p.addEventListener('pointerup', (event) => {
console.log(event.target.getAttribute('id') + ' pointerup');
event.target.releasePointerCapture(event.pointerId);
});
p.addEventListener('pointercancel', (event) => {
console.log(event.target.getAttribute('id') + ' pointercancel');
});
}
</script>
</body>
</html>