Find position of element inside iframe with id

I am using the below to get its position at the top

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

      

How can one get the position if the element is inside an iframe and the iframe is not on the same domain ?

+3


source to share


1 answer


you can only access another iframe if the other domain has adopted cross origin. so if this is not your domain you probably need to ask them to allow it if possible



0


source







All Articles