Skip to content

Instantly share code, notes, and snippets.

@floydian
Created September 26, 2009 15:07
Show Gist options
  • Save floydian/194281 to your computer and use it in GitHub Desktop.
Save floydian/194281 to your computer and use it in GitHub Desktop.
YUI().use('node', 'dd-drag', function (Y) {
Y.on('contentready', function (e) {
var dds = [],
els = Y.all('#ex1Page .box').each(function (el) {
var key = dds.length;
dds[key] = new Y.DD.Drag({
node: el
});
});
function bringUp(node) {
node.setStyle('zIndex', 2);
}
function bringDown(node) {
node.setStyle('zIndex', 1);
}
Y.DD.DDM.on('drag:start', function (e) {
bringUp(e.target);
});
Y.DD.DDM.on('drag:end', function (e) {
bringDown(e.target);
});
}, '#ex1Page');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment