Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    get image top/left absolute position in IE ??

    I need to capture an image's x/y position using IE. I have the script code for FF/NS working perfectly, but I can't seem to find a way to capture the absolute position in IE.

    Here's my script that works in FF/NS:
    <SCRIPT>
    function moveleft(which)
    {
    document.getElementById(which).style.position="absolute"; document.getElementById(which).style.left=document.getElementById(which).x - 20;
    }
    </SCRIPT>

    <IMG src="images/blue_logo_100x100.jpg" height="100" name="bluelogo" id="bluelogo" width="100" onclick="moveleft('bluelogo');">
    I've tried functions that loop through the DOM and calculate the position, but they still don't return the abs position. (here's one I tried IE abs pos to no avail)

    How can I capture the abs position in IE, and why is it so *#@( tough?
    Thanks!

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    See if this works for you:

    Finding Position

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •