Skip to content

Instantly share code, notes, and snippets.

@davidworkman9
Created September 24, 2013 15:05
Show Gist options
  • Save davidworkman9/6686144 to your computer and use it in GitHub Desktop.
Save davidworkman9/6686144 to your computer and use it in GitHub Desktop.
Node array to jQuery selector
var nodes = someFunc();
var droppableNodes = [], i = 0;
for(i = 0; i < nodes.length; ++i) {
if(isDroppableNode(nodes[i])
droppableNodes.push(nodes[i]);
}
$(nodes).droppable({
drop: function () {
// drop logic here.
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment