1

how to find distance between window top position and my iframe start position.

I tried with this approach Determine distance from the top of a div to top of window with javascript but it is not working for me.

Please suggest a solution.

Community
  • 1
  • 1
javalearner
  • 3,314
  • 7
  • 26
  • 33

1 Answers1

1

I've tried using this approach:

    var topDistance = $('iframe')[0].offsetTop;

With varying success. Which, with your tag name would be:

    var topDistance = $('#myframeId').offsetTop;