OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../js/resources/js-test-pre.js"></script> |
5 <script> | 5 <script> |
6 window.jsTestIsAsync = true; | 6 window.jsTestIsAsync = true; |
7 | 7 |
8 document.addEventListener('DOMContentLoaded', function () { | 8 document.addEventListener('DOMContentLoaded', function () { |
9 listenForEvents(document.querySelector('#outer')); | 9 listenForEvents(document.querySelector('#outer')); |
10 listenForEvents(document.querySelector('#inner1')); | 10 listenForEvents(document.querySelector('#inner1')); |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 } | 41 } |
42 | 42 |
43 function listenForEvents(el) { | 43 function listenForEvents(el) { |
44 ['mouseover', 'mouseout', 'mouseenter', 'mouseleave'].forEach(functi
on(type) { | 44 ['mouseover', 'mouseout', 'mouseenter', 'mouseleave'].forEach(functi
on(type) { |
45 el.addEventListener(type, handleEvent); | 45 el.addEventListener(type, handleEvent); |
46 }); | 46 }); |
47 } | 47 } |
48 </script> | 48 </script> |
49 <script src="../js/resources/js-test-post.js"></script> | |
50 | 49 |
51 <style> | 50 <style> |
52 #outer { | 51 #outer { |
53 background: blue; | 52 background: blue; |
54 height: 100px; | 53 height: 100px; |
55 left: 100px; | 54 left: 100px; |
56 position: absolute; | 55 position: absolute; |
57 top: 100px; | 56 top: 100px; |
58 width: 100px; | 57 width: 100px; |
59 } | 58 } |
(...skipping 26 matching lines...) Expand all Loading... |
86 </head> | 85 </head> |
87 <body> | 86 <body> |
88 <div id="outer"> | 87 <div id="outer"> |
89 <div id="inner1"></div> | 88 <div id="inner1"></div> |
90 <div id="inner2"> | 89 <div id="inner2"> |
91 <div id="inner3"></div> | 90 <div id="inner3"></div> |
92 </div> | 91 </div> |
93 </div> | 92 </div> |
94 </body> | 93 </body> |
95 </html> | 94 </html> |
OLD | NEW |