Jquery Lazy Load for iFrame?

I’m using Jquery Lazy Load for Images: http://www.appelsiini.net/projects/lazyload

I was hoping to use the same script to do lazyloading of lower iframes, but hit a snag… I can’t get it to work.

Looks like the script is really only images, and does some weird modifications to my iframe I’m trying to lazyload.

$("iframe.testframe").lazyload({
        effect : "fadeIn",
        threshold : 24
        });

<iframe data-original="http://www.somepage.com" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:400px; width:350px" allowTransparency="true" class="testframe"></iframe>

Is there a way to get this script to work with iframe or do I need to go on the hunt for another lazy load script that can do both images and iframes?

All feedback appreciated.

Cheers!
Ryan

1 Like

If the iframe’s source is a page that you control you should add that script to that page, not the parent. If you don’t have control over that page there’s nothing you can do as image lazy load scripts require HTML changes to work.

1 Like

Lazy Load actually came up with this edit that resolves it:

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.