YUI 3.x Home -

YUI Library Examples: Node: Node Positioning

Note: This is YUI 3.x. Looking for YUI 2.x?

Node: Node Positioning

This example shows how to position an element based on the document XY coordinate system.

Setting up the HTML

First we need some HTML to work with.

Getting the Dimensions

In this example, we will listen for clicks on the document and update the position of our demo node to match the click position.

The last step is to assign the click handler to the document to capture all click events.

Full Script Source

Copyright © 2009 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings