div element x y offset problem vs pointer

Discussion in 'JavaScript' started by troyd1, Oct 4, 2007.

  1. #1
    I have found a problem with the coordinates of the cursor vs the coordinates of a div element in ie7. Not sure about earlier versions. Works fine in firefox. If you look at http://www.premierecolors.com/testpos2.html. I have placed that div at 0,0. If I drag down slowly, it will fire from the mouseover when it touches the top of the div. The div is positioned at 0. The cursor always shows 2 in ie. If you do the same thing in firefox, it always shows 0 for the pointer. It works the same from the left. If I add mousemove code, you can see the position changing above and to the left of the div even though it is located at 0,0. See this example:
    http://www.premierecolors.com/TESTPOs3.HTML
    I added an onmousemove to continuously update the mouse coordinates. If you start at the top or left, you can see the cursor go from 0 to 1 and then when it hits 2, it fires the mouseover and shows the div coordinates. The div is positioned at 0,0 the div coords should show the first time the pointer position changes. I think there is another offset that is in ie7 that is 2 pixels that is not being accounted for or there is a bug. It works fine in firefox.

    Thanks in advance for any help, Troy
     
    troyd1, Oct 4, 2007 IP
  2. troyd1

    troyd1 Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    If you try these links, please post your results and your browser version.
     
    troyd1, Oct 4, 2007 IP