Alex Rivera | Logout

How to detect if an element is visible within an iframe that is on a cross domain parent

Asked 2012-04-02T13:03:19.870
8

Just as the question states, I have an iframe that is on a cross domain parent. I need to trigger an event if that content is scrolled into view or already in view on page load. Normal checks for distance from top/side of page and viewport height/width don't seem to work as they measure the page within the iframe itself.

I cannot edit/add anything on the parent page to enable this functionality, everything must be within the iframe itself.

The reason behind this is to record whether content has ever had the chance to be viewed by the user or if it was loaded out of view and kept there.

There are companies who provide this service for advertising, but as far as finding out how it is actually done, well it seems to be one of the dark arts.

Any help would be greatly appreciated.

EDIT: Two examples of the companies I spoke of who offer this service.

  1. View the first tick under (4) http://www.doubleverify.com/what-is-verification/
  2. First thing they state they can do on the right hand side http://adxpose.com/home.page
Edit
Report

1 Answer

0

doubleverify and adxpose use "offline" techniques to determine if the ad was visible or not, it doesn't happen on the page view. If they did it through Javascript, all you would have to do is look at one of their pixels to see how it works.

answered 2013-01-09T23:01:51.743

Your Answer