-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
55 lines (37 loc) · 779 Bytes
/
test.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
<!DOCTYPE html>
<html>
<head>
<style>
#container {
margin: 20px;
padding: 20px;
background: grey;
}
</style>
</head>
<body>
<div id="container">
<div>Text in a div</div>
<div><div><div>and some nested divs</div></div></div>
and more text
</div>
<div id="log"></div>
<script src="build/build.js"></script>
<script>
var mouseInOut = require('mouse-inout')
, el = document.querySelector('#container')
, log = document.querySelector('#log')
;
mouseInOut.bind(el, 'mouseenter', function (e) {
var m = document.createElement('div');
m.innerHTML = 'Mouse Enter';
log.appendChild(m);
});
mouseInOut.bind(el, 'mouseleave', function (e) {
var m = document.createElement('div');
m.innerHTML = 'Mouse Leave';
log.appendChild(m);
});
</script>
</body>
</html>