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 ?
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