desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 386 forks source link

Getting left position while dragging #88

Closed babysteps closed 9 years ago

babysteps commented 9 years ago

I am using draggabilly with the following settings:

{ axis: 'x', containment: [containerElement], grid:[10,0] }

to allow dragging left and right within the container on a 10px grid increment. During the 'dragMove' event I would like to get the current 'left' position of the drag element (position from the left of the container). Is this possible? The pointer object returns where the pointer is, but I want to know where the draggable element is. I have seen in the inspector that it is using transform: translate3d() to reposition the element, but have not had any luck in getting that value during the 'dragMove' event.

Thanks in advance for your help. This is a great plugin!

desandro commented 9 years ago

See CodePen - Draggabilly - dragMove with jQuery. Use draggie.position

babysteps commented 9 years ago

Thank you so much! It works perfectly.

z1haze commented 7 years ago

how about without jquery?