Skip to content

Instantly share code, notes, and snippets.

@drale2k
Created August 3, 2012 15:06
Show Gist options
  • Save drale2k/3248441 to your computer and use it in GitHub Desktop.
Save drale2k/3248441 to your computer and use it in GitHub Desktop.
item = $z(e.currentTarget)
screen_center_x = $z(window).width() / 2
screen_center_y = $z(window).height() / 2
move_to_x = screen_center_x - item.data("screen-offset-x")
move_to_y = screen_center_y - item.data("screen-offset-y")
# Problem: This returns "true" or "false", instead of "-1000px" or "1000px"
item_origin = (item.data("screen-offset-y") > screen_center_y) ? "-1000px" : "1000px"
console.log item_origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment