Ian Davies wrote:
I think javascript ans CSS is the solution for my problem. I wish to use
them to retreive the relative coordinates of an element on webpage and store
it in an text field on pressing a button. or preferably have the text boxes
continuously update with the coordinates as a I drag the elements around. I
have borrowed some code to move the elements but Im new to javascript and
need a few pointers or links to something along these lines.
If you want to learn about element position, read here:
<URL:
http://www.quirksmode.org/js/introdh.html >
Please check out my test page to see what I need to do and what Ive done so
far
http://www.iddsoftware.co.uk/test.php
The script is junk, some extracts below:
<script language="JavaScript1.2">
That may have serious repercussions in some browsers in certain
circumstances:
<URL:
http://groups.google.com.au/group/co...016d805f3dc13e
>
Ditch the language attribute completely and use the required type attribute:
<script type="text/javascript">
[...]
function drags(){
if (!document.all)
return
[...]
That test makes your script dependent on support for a very old,
proprietary and deprecated method, resulting in your script not working
in perhaps 30% of web browsers.
There are numerous other examples of very bad coding style, e.g.
document.onmouseup=new Function("dragapproved=false")
--
Rob