Javascript genuine absolute positioning

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zom
    New Member
    • Sep 2007
    • 6

    Javascript genuine absolute positioning

    I have looked around a lot for a cross browser script that will give me the absolute screen position of an element withinin a frame, so that I can pop up a window right next to it. So far I have been unable to find one that works for just IE, Firefox and Opera.

    I am assuming this is not an easy thing to do.

    Can anyone help me with this problem, or is it just too hard?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Do you mean the screen or the position within the page?

    Have you tried the top and left properties?

    Comment

    • zom
      New Member
      • Sep 2007
      • 6

      #3
      Originally posted by acoder
      Do you mean the screen or the position within the page?

      Have you tried the top and left properties?
      How can I place a pop up using page positions?

      If I can use the page position to pop up a new window then page position will work. Otherwise I will need screen position.

      Yes I have tried top and left properties but IE(5&6) gives rubbish results for top, perhaps because of the frame.

      Comment

      • zom
        New Member
        • Sep 2007
        • 6

        #4
        I solved my problem using event.screenX and Y.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Originally posted by zom
          I solved my problem using event.screenX and Y.
          Yes, they work cross-browser for the screen. If you wanted something within the page, try this Find Position article.

          Comment

          Working...