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
    Jul 2002
    Location
    Basle, Switzerland
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to retrieve image position?

    Hello

    Is there a possibility to get the position of an image on mac IE4.x browsers? I've tried several things, but without success. Does anybody have a solution? Thank you.

    Following code works fine for almost all browsers except IE4.x on mac:

    function getImgLeft( id )
    {
    if ( document.getElementById || document.all )
    {
    return getParentLeft( document.images[id] );
    }
    else if ( document.layers )
    {
    return document.images[id].x;
    }
    }

    function getParentLeft( obj )
    {
    if ( obj.offsetParent )
    {
    return obj.offsetLeft + getParentLeft( obj.offsetParent );
    }
    else
    {
    if ( obj.offsetLeft ) return obj.offsetLeft;
    else return 0;
    }
    }

    var left = getImgPos( "imagename" );

  • #2
    New Coder
    Join Date
    Jul 2002
    Location
    USA, East Coast
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    layers?

    Would wrapping the image in a layer the exact size of the image allow you to get a position on it?

    The only other thing I was thinking is that IE is near viral in its installs where your users will be getting updates. So unless you know of an actual user group that has the 4.x browsers installed on the Mac's. I would just do a browser detect in the beginning and tell the 4.x users to upgrade to 5.0/5.5.

    I am getting to the point where I dont think anyone should use less then IE 5.0. As far as Netscape goes... I am hoping the last of the holdouts on 4.7x will just change over to IE 5.0. (my company included) The 4.x browsers are just crap. And its 2002...

    -S. Bob


  •  

    Posting Permissions

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