![]() |
Coordinates of a draggable object
Does anyone know how to store the coordinates of a draggable image in a .txt file, to allow the same image to be re-loaded in the same position on another page?
Hope someone can help, Thanks :pleased: |
Re: Coordinates of a draggable object
All you are trying to do is store some numbers in a file and what makes you think it cannot be done.
|
Re: Coordinates of a draggable object
I know it can be done, and i know that i need to use GetElementById, e.clientX, and e.ClientY. But im new to this and just wanted some advice of how to go about it.
Thanks |
Re: Coordinates of a draggable object
But the clientx and clienty gives the current mouse position and not the image's position on a screen.
You can do as follows: Code:
var x = document.images.imagename.offsetLeft; |
Re: Coordinates of a draggable object
This is quite usefull, how would one submit this into a form textarea when the form is submitted?
|
Re: Coordinates of a draggable object
Create a javascript which takes the above two values as arguments. Inside the function, use:
Code:
// here 'txtarea' inside brackets is the ID set for the textarea tag |
| All times are GMT +5.5. The time now is 15:50. |