WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Figuring out the position of an element inside an iframe relative to the browser edge, Michael Sheakoski, September 13, 2003
     Re:Figuring out the position of an element inside an iframe relative to the browser edge, Erik Arvidsson, September 13, 2003
         Re:Figuring out the position of an element inside an iframe relative to the browser edge, Erik Arvidsson, September 13, 2003
             Re:Figuring out the position of an element inside an iframe relative to the browser edge, Michael Sheakoski, September 14, 2003

Subject: Re:Figuring out the position of an element inside an iframe relative to the browser edge From: Erik Arvidsson Date: September 13, 2003
The best way is to use the following (more or less).

1. Find the position relative to the viewport canvas (clientLeft, getBoundingClientRect().left)
2. Modify the value for the canvas border due to bugs in IE
3. Find the position of the window object representing the frame relative to the screen (window.screeLeft). This might give incorrect values for dual monitors with buggy drivers.
4. Find the position of the topmost window object relative to the screen (top.screenLeft) and get the difference.

Take a look at the poslib.js included in DHTML Menu 4 (take a fairly new one because the first ones were buggy)

erik



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX