I am finding the current X and Y position in ‘touchend‘ event. Now say the original position of ImageView is ; left=100 and top=100. On touchend it just gives value in 2 digits that is either 8,10 or 9,11 etc. Now I am not sure what’s the offset of image view. If it is lastLeft+x and lastTop+y then it’s not gonna work at all. What all I want to save current position of Image at TouchEnd in Db so that I could restore it later.
Kindly help me
My original answer was incorrect: here’s an updated version.
The globalpoint property in the event object contains the coordinates on the screen that the user clicked on, while the x and y properties are the coordinates within the view at which the user clicked. By taking one away from the other (and, depending on whether your screen has a status bar, allowing for that too) you can work out the top/left of the object after an animation finishes.
I’ve put together a demo that works in 1.6.0 which demonstrates this (just create a new project and replace app.js with the following code)