How to I calculate absolute position of individual frames inside a frameset (Javascript)

101 Views Asked by At

I have to support a website that still supports framesets. My use case is to find the absolute position of a frame in the frameset. I can get its width and height, but I also need its left and top coordinate. I need this to find an element's position inside the frame with respect to the main document.

Sample code can be taken from https://www.javatpoint.com/oprweb/test.jsp?filename=htmlframetag2

I just need a way to determine where the frame's computed position is.

1

There are 1 best solutions below

0
user3908730 On

Wasn't working probably because I was only running the script for the main window frames. Works with recursion now.