Date: September 12, 2006
Component: Event, Dom
Version: v0.11.3
The combination of the Event Utility and the Dom Collection makes it really easy to do what Michael asks for in this YDN-JavaScript post: Namely, to get the mouse coordinates during a click and make an arbitrary piece of content appear next to where the mouse is located. Click anywhere on this page to see the effect in action.
Start with some simple CSS code for the appearing elements, which will be positioned absolutely, outside of the page flow:
Next, listen for a click anywhere on the page. When that event happens, create (if necessary) the content you want to position and then, in line 11 below, use the combination of Dom and Event to getXY using Event on the event object and feed those coordinates into a setXY on the new element using Dom.
— Eric Miraglia, Yahoo Presentation Platform Engineering
(c)2006-2007 Yahoo Inc.