Skip to content

Instantly share code, notes, and snippets.

@sivabudh
Created December 19, 2011 19:49
Show Gist options
  • Save sivabudh/1498578 to your computer and use it in GitHub Desktop.
Save sivabudh/1498578 to your computer and use it in GitHub Desktop.
script to move elements
list = $('#answers')
first = $(list.children()[0])
second = $(list.children()[1])
top = first.offset().top
bottom = second.offset().top
offsetDiff = bottom - top
dragDistance = offsetDiff+1
console.log dragDistance
first.simulate('drag', dy: dragDistance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment