OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <style> | 3 <style> |
4 body { | 4 body { |
5 margin: 0px; | 5 margin: 0px; |
6 padding: 0px; | 6 padding: 0px; |
7 } | 7 } |
8 #mybox { | 8 #mybox { |
9 padding: 20px; | 9 padding: 20px; |
10 margin: 0px; | 10 margin: 0px; |
11 border: 1px solid #000; | 11 border: 1px solid #000; |
12 } | 12 } |
13 #mystatus { | 13 #mystatus { |
14 border: 1px solid #000; | 14 border: 1px solid #000; |
15 padding: 20px; | 15 padding: 20px; |
16 margin: 0px; | 16 margin: 0px; |
17 } | 17 } |
18 </style> | 18 </style> |
19 <script> | 19 <script> |
20 var state = ''; | 20 var state = ''; |
| 21 var hasLeave = false; |
21 function load() { | 22 function load() { |
22 state = 'initial'; | 23 state = 'initial'; |
23 document.getElementById("mystatus").innerHTML = state; | 24 document.getElementById("mystatus").innerHTML = state; |
24 document.title = "onload"; | 25 document.title = "onload"; |
25 } | 26 } |
26 function enter() { | 27 function enter() { |
27 state += ',entered'; | 28 state += ',entered'; |
28 document.getElementById("mystatus").innerHTML = state; | 29 document.getElementById("mystatus").innerHTML = state; |
29 document.title = "entered"; | 30 document.title = "entered"; |
30 } | 31 } |
31 function leave() { | 32 function leave() { |
| 33 hasLeave = true; |
32 state += ',left'; | 34 state += ',left'; |
33 document.getElementById("mystatus").innerHTML = state; | 35 document.getElementById("mystatus").innerHTML = state; |
34 document.title = "left"; | 36 document.title = "left"; |
35 } | 37 } |
| 38 function done() { |
| 39 state += ',done'; |
| 40 document.getElementById("mystatus").innerHTML = state; |
| 41 document.title = hasLeave ? "with mouseleave" : "without mouseleave"; |
| 42 } |
36 </script> | 43 </script> |
37 </head> | 44 </head> |
38 <body onload="load()"> | 45 <body onload="load()"> |
39 <div id="mybox" onmouseover="enter()" onmouseout="leave()"></div> | 46 <div id="mybox" onmouseover="enter()" onmouseout="leave()"></div> |
40 <div id="mystatus"></div> | 47 <div id="mystatus"></div> |
41 </body> | 48 </body> |
42 </html> | 49 </html> |
OLD | NEW |