-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
92 lines (84 loc) · 1.66 KB
/
test.html
File metadata and controls
92 lines (84 loc) · 1.66 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<title>Event Propagation</title>
<style>
#t-daddy { border: 1px solid red }
#c1 { background-color: pink; }
</style>
<script>
function stopEvent(ev) {
c2 = document.getElementById("c2");
c2.innerHTML = "hello";
// this ought to keep t-daddy from getting the click.
ev.stopPropagation();
alert("event propagation halted.");
}
function load() {
elem = document.getElementById("tbl1");
elem.addEventListener("click", stopEvent, false);
}
</script>
<style>
.left-arrow {
display: inline-block;
position: relative;
background: grey;
padding: 5px;
width: 20px;
height: 10px;
}
.left-arrow:after {
content: '';
display: block;
position: absolute;
right: 100%;
top: 50%;
margin-top: -10px;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-right: 10px solid grey;
border-bottom: 10px solid transparent;
border-left: 10px solid transparent;
}
.right-arrow {
position: relative;
background: grey;
padding: 5px;
width: 20px;
height: 10px;
}
.right-arrow:after {
content: '';
display: block;
position: absolute;
left: 100%;
top: 50%;
margin-top: -10px;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 10px solid grey;
}
</style>
</head>
<body onload="load();">
<table id="t-daddy" onclick="alert('hi');">
<tr id="tbl1">
<td id="c1">one</td>
</tr>
<tr>
<td id="c2">two</td>
</tr>
</table>
<div class="left-arrow"></div>
<div id="out">
<div style="float:left">left</div>
<div style="float:left">middle</div>
<div class="right-arrow" style="float:right"></div>
</div>
</body>
</html>