Share Posted November 7, 2013 Hi guys! I'm not yet very experienced in HTML/JS, I come from AS3, don't blame me ! I'd like to get the X position of an element when user is moving it in order to know when this element is touching another and fire some events (like a collision or something). I've tried this but it doesn't work : Draggable.create( $mainProduct , { type:"x,y", edgeResistance:0.4, bounds:"#dragAndDrop", throwProps:true, onDrag:function() { $("h2").text( parseInt ($mainProduct.css('left'))); } It always return the initial position (50 in my case) wherever is the element. Thanks a lot Link to comment Share on other sites More sharing options...
Author Share Posted November 7, 2013 Pfff.. Sorry for bothering! Simple as this : parseInt (this.y); Please ignore this post!!! BTW, thank you for your amazing products 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now