Yahoo! recommends YUI 3. Learn about YUI 3 on YUILibrary.com.
This example demonstrates how to implement a custom click validator to make a circular drag and drop implementation. Because all DOM elements that have dimensions are rectangular, the way to implement a circular drag object is to perform calculations on mousedown to determine whether the mouse was targeting a valid portion of the element (eg, a portion within the circle).
The same method could be used to create any non-rectangular draggable object.
The Drag & Drop Utility lets you make HTML elements draggable.
For this example, we will enable drag and drop for the three <div> elements.
Markup:
Code:
You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.
Note: Logging and debugging is currently turned off for this example.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.

Copyright © 2013 Yahoo! Inc. All rights reserved.