mouse-events.html
2.45 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CasperJS test mouse events</title>
<style>#menu { display:block;} #menu:hover ul { display:block !important;visibility:visible !important; }</style>
</head>
<body>
<a id="test1" href="#" onmousedown="results.test1 = true;">test</a>
<a id="test2" href="#">test</a>
<a id="test3" href="#" onmouseup="results.test3 = true;">test</a>
<a id="test4" href="#">test</a>
<a id="test5" href="#" onmouseover="results.test5 = true;">test</a>
<a id="test6" href="#">test</a>
<a id="test7" href="#" onmouseout="results.test7 = true;">test</a>
<a id="test8" href="#">test</a>
<span id="menu"><a class="menu-survol" href="javascript:void(0)">MENU (move over me)</a>
<ul style="display:none;visibility:hidden;"><li><a id="test9" href="#" onclick="results.test9 = true;">test</a></li>
<ul style="display:none;visibility:hidden;"><li><a id="test10" href="#">test</a></li>
</ul>
</span>
<script>
(function(window) {
window.results = {
test1: false,
test2: false,
test3: false,
test4: false,
test5: false,
test6: false,
test7: false,
test8: false,
test9: false,
test10: false
};
document.querySelector('#test2').onmousedown = function(event) {
results.test2 = true;
event.preventDefault();
};
document.querySelector('#test4').onmouseup = function(event) {
results.test4 = true;
event.preventDefault();
};
document.querySelector('#test6').onmouseover = function(event) {
results.test6 = true;
event.preventDefault();
};
document.querySelector('#test8').onmouseout = function(event) {
results.test8 = true;
event.preventDefault();
};
document.querySelector('#test10').onclcik = function(event) {
results.test10 = true;
event.preventDefault();
};
})(window);
</script>
</body>
</html>