jQuery LazyLoad Ad

jQuery LazyLoad Ad is a great jQuery script, that allows us to lazy load ads on a page.

A lot of ad providers use embed codes, that are based on document.write(), which can cause a lot of problems. A common solution to this problem is to load ad in an iFrame, but is not always possible to implement this (streching ads are one of the cases).

jQuery LazyLoad Ad will allow you to still embed your ads inline, but will delay their display until site was completely loaded. Even more; ads will not be loaded until actually visible on page by default.


Download module and enable it. Then navigate to admin/config/system/lazyloadad and configure jQuery selectors for your ads. Ads must be modified to work with this script. A typical AdSense embed code would look like this:

The same code, rewritter to be used will look like this:

<!-- google_ad_client = "pub-8333082972366661"; google_ad_slot = "9789857825"; google_ad_width = 300; google_ad_height = 250; //-->

See jQuery LazyLoad Ad docs for more info.


There are some concerns if you are allowed to use this script with Google AdSense. Please refer to #1332832: Google AdSense policy for more info.

Project Information