Mercurial > hg > batmud > maputils
comparison tooltip.js @ 1769:57276229a8c8
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Oct 2017 22:20:25 +0300 |
parents | 31a454a73f8e |
children | 78dcae610ce3 |
comparison
equal
deleted
inserted
replaced
1768:7db813d0d2a6 | 1769:57276229a8c8 |
---|---|
36 | 36 |
37 | 37 |
38 // Update the tooltip box | 38 // Update the tooltip box |
39 function utt(e) | 39 function utt(e) |
40 { | 40 { |
41 x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX; | 41 var x = document.all ? (window.event.x + document.body.scrollLeft) : e.pageX; |
42 y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY; | 42 var y = document.all ? (window.event.y + document.body.scrollTop) : e.pageY; |
43 if (mytt != null) | 43 if (mytt != null) |
44 { | 44 { |
45 var winW = 0, winH = 0; | 45 var winW = 0, winH = 0; |
46 var boxW = mytt.clientWidth + 25, boxH = mytt.clientHeight + 25; | 46 var boxW = mytt.clientWidth + 25, boxH = mytt.clientHeight + 25; |
47 | 47 |
72 if (y + boxH + 15 >= winH) | 72 if (y + boxH + 15 >= winH) |
73 y -= boxH; | 73 y -= boxH; |
74 else | 74 else |
75 y += 15; | 75 y += 15; |
76 | 76 |
77 myx = x; myy = y; | 77 myx = x; |
78 myy = y; | |
78 | 79 |
79 mytt.style.left = x + "px"; | 80 mytt.style.left = x + "px"; |
80 mytt.style.top = y + "px"; | 81 mytt.style.top = y + "px"; |
81 } | 82 } |
82 } | 83 } |