Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Find iframe element absolute coordinates

 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a small iframe with elements when I move mouse over I want to see status popup fed by Ajax. It works fine, however popup div defined in iframe can't overlap parent window and gets clipped out. For this reason I moved it in a main window. Now I have to figure main window coordinates of popup which will be shown by side of an iframe element. I tried iframe.offsetTop and iframe.offsetLeft added to element coordinates, however they are always 0. I found work around using coordinates of an element where iframe inserted in, but it won't be always the case. So, how I can find absolute coordinates of iframe? Sorry for a beginner question.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
basic idea:



Eric
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bingo. I forgot that my iframe inside some other element.
 
Riho Richards
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello I have a problem related to this.

I have the following iframe:



this iframe tag is enclosed with <td> tags and I would like to extract the location and coordinates of the iframe. I happened to have a very similar function that does this:



So, to get the top location of my iframe, i make a call:

getCurrTop("myContent");

This works perfectly fine in firefox, but returns 0 in internet explorer... any idea why? Thanks in advance for your help.

[ March 31, 2006: Message edited by: Riho Richards ]

[ March 31, 2006: Message edited by: Riho Richards ]
[ April 03, 2006: Message edited by: Riho Richards ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and ad is?
 
Riho Richards
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops sorry, hehe code is fixed... i applied the modification and i still get the same problem.
 
Riho Richards
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i'm just being dumb... it was a bug elsewhere that caused my issue. thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic