AAPL Reload Codes

The reload codes below can help get Ajax Page Loader working with various plugins and JavaScript you may be using that will break as a result of AAPL modifying the DOM when it replaces the page DOM with the new page data.


Social Media Reloads (Various)

There are many social media plugins on the internet, the codes below are generic to each of these and will most likely work in all cases.

Facebook Reload

FB.XFBML.parse();

Twitter Reload

twttr.widgets.load();

Sharethis Reload

stButtons.locateElements();

jScrollPane (JavaScript Library)

jScrollPane is a useful JavaScript library used in many other plug-ins, it enables you to skin the scroll bars of content within your website allowing the scrollbars to match the theme of your website.

jQuery('.scroll-pane').jScrollPane();
Usage:
The above code can be used to reload this feature after the page has been changed by AAPL, replace .scroll-pane with the class/id of the container you need to reload.

Nivo Slider (WordPress Plugin)

Nivo Slider is a fantastic WordPress plug-in that enables you to embed stunning sliders into your website.

jQuery('#slider').nivoSlider({
pauseTime:3000,
effect:'boxRandom',
animSpeed:700,
directionNav:true,
controlNav: false
});
Usage:
The above code can be used to reload this feature after the page has been changed by AAPL, replace #slider with the id of the container you need to reload.

Lazy Load (jQuery Plug-in)

Lazy Load forces images on a page to load once they are scrolled to instead of instantly, this is useful for improving the initial page load speed and saving bandwidth.

jQuery( 'img[data-lazy-src]' ).bind( 'scrollin', { distance: 200 }, function() {
var img = this,
$img = jQuery(img),
src = $img.attr( 'data-lazy-src' );
$img.unbind( 'scrollin' ) // remove event binding
.hide()
.removeAttr( 'data-lazy-src' )
.attr( 'data-lazy-loaded', 'true' );
img.src = src;
$img.fadeIn();
});
Usage:
The above code can be used to reload this feature after the page has been changed by AAPL.

Contact Form 7 (WordPress Plug-in)

Contact Form 7 allows the easy creation of contact forms in your WordPress site.

jQuery.get('/wp-content/plugins/contact-form-7/scripts.js', function(data) { eval(data); });
Usage:
The above code can be used to reload this feature after the page has been changed by AAPL.

Addthis Social Buttons (WordPress Plug-in)

Addthis is a nice little plugin that implements the Addthis widgets into your WordPress site enabling instant social interaction.

// Addthis
if (window.addthis) {
window.addthis = null;
window._adr = null;
window._atc = null;
window._atd = null;
window._ate = null;
window._atr = null;
window._atw = null;
}
jQuery.getScript('http://s7.addthis.com/js/250/addthis_widget.js#pubid=YOUR-PUBID');
Usage:
The above code can be used to reload this feature after the page has been changed by AAPL. You need to replace YOUR-PUBID with the correct PUBID from Addthis.

Disqus Comment System (WordPress Plug-in)

Disqus, pronounced "discuss", is a service and tool for web comments and discussions. Disqus makes commenting easier and more interactive, while connecting websites and commenters across a thriving discussion community.

(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
Usage:
The above code can be used to reload this feature after the page has been changed by AAPL.

Slideshow Satellite (WordPress Plug-in)

Satellite's goal is to present a responsive and beautiful slideshow experience to visitors of your WordPress site.

jQuery('#featured').satlorbit({});
Usage:
The above code can be used to reload this feature after the page has been changed by AAPL. You may need to change #featured to the class/id of your container in order to reload.

Lightbox Gallery (WordPress Plug-in)

Satellite's goal is to present a responsive and beautiful slideshow experience to visitors of your WordPress site.