0

I have an html template which gets included in my main page that looks like this:

<div id="ad_id">
    <script>
        adcompany.items.push(function () {
            adcompany.display('ad_id');
        });
    </script>
</div>

So basically I will have a <div> which has some ad code implemented which will dynamically render an iframe inside as soon as the page is loaded. Inside of this iframe there are multiple images rendered to the page.

Ever since the rest of the images on page are lazily loaded, I would like to have the content of the iframe lazily loaded as well - so as soon as it's in the viewport, the iframe will be loaded.

I have tried almost everything I found on the web:

lazy load iframe (delay src http call) with jquery

How to lazyload a iframe with caching in mind

Unfortunately nothing worked out and I wouldn't like to use an external plugin.

I would like to give some code examples, but quite frankly I don't really know where to start here so maybe somebody else had this occasion already.

Thanks!

wasddd_
  • 937
  • 2
  • 10
  • 19
  • well does it (the library) support loading after the page loads? The answer really relies on the ad code and how it adds the iframe to the page. – epascarello Sep 27 '17 at 13:28
  • I have found the solution here: https://developers.google.com/doubleclick-gpt/reference – wasddd_ Sep 28 '17 at 14:02

0 Answers0