3

I am using the below to get its position away from the Top

var posTop = document.getElementById('elementId').getBoundingClientRect().top 
- document.body.getBoundingClientRect().top

How is it possible to get its position if the element is inside an iframe and the iframe is not in the same domaine?

Chdid
  • 280
  • 3
  • 7
  • If [you can control](http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy) the other page, otherwise not possible. – Teemu Jun 11 '15 at 16:52

1 Answers1

0

you can access to other iframe just if the other domain accepted cross-origin. so, if it's not your domain, you probably need to ask them to allow that, if possible

gididaf
  • 175
  • 4
  • 12
  • 1
    I tried to allow the cross-origin but didn't work for me. Can you provide a simple example ? – Chdid Jun 18 '15 at 14:24