This file tests the code to determine mouse position and element position with respect to the document or viewport.
dojo.html.getCursorPosition() returns the position of the cursor relative to the document (not relative to the viewport), meaning that scrolling the browser window will increase the value returned.
Likewise, dojo.style.getAbsolutePosition(xyz, true) tells you where you would position a node inside document.body such that it was on top of xyz. It works well in conjunction with dojo.html.getCursorPosition().
dojo.style.getAbsolutePosition(xyz, false) returns the position that would be returned by event.clientX/Y if the mouse were directly over the top/left of this node.
dojo.html.getCursorPosition() | |
getAbsolutePosition(btn, true) (document) | |
getAbsolutePosition(btn, false) (viewport) | |
dojo.html.overElement(btn, e) | |
dojo.html.getScrollLeft()/Top() |
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after
HTML after