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.

Installation

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:

<script type="text/javascript"><!--
	google_ad_client = "pub-8333082972366661";
	/* 300x250, date de création 18/03/10 */
	google_ad_slot = "9789857825";
	google_ad_width = 300;
	google_ad_height = 250;
	//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

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

<div class="my_ad" original="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	&lt;!--&#10;		google_ad_client = &quot;pub-8333082972366661&quot;;&#10;		google_ad_slot = &quot;9789857825&quot;;&#10;		google_ad_width = 300;&#10;		google_ad_height = 250;&#10;		//--&gt;&#10;	
</div>

See jQuery LazyLoad Ad docs for more info.

Notice

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

  • caution Seeking co-maintainer(s)
    Maintainers are looking for help reviewing issues.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon4 sites report using this module
  • Created by slashrsm on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases