Position function tests

This file tests the code to determine mouse position and element position with respect to the document or viewport.

dojo.html.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 event.pageX/Y.

dojo.html.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.

1
2
3

4
5
6
7 This is a very long sentence just to make sure there is a horizontal scrollbar
event.pageX/pageY
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