Add the code you need on ZAJAX admin plugin page on the Ajax send or Ajax Complete as needed.
Social Media Reloads
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
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 ZAJAX, replace .scroll-pane with the class/id of the container you need to reload.
Lazy Load
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 charged by ZAJAX.
Contact Form 7
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 ZAJAX.
Disqus Comment System
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 ZAJAX.
Slideshow Satellite
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 ZAJAX. You may need to change #featured to the class/id of your container in order to reload.
Lightbox Gallery
Satellite's goal is to present a responsive and beautiful slideshow experience to visitors of your WordPress site.
jQuery(document).ready(function () { jQuery(".gallery1 a").attr("rel","gallery1"); jQuery('a[rel="gallery1"]').colorbox({title: function(){ return jQuery(this).children().attr("alt"); }}); });
Usage:
The above code can be used to reload this feature after the page has been changed by ZAJAX. You may need to change gallery1 to the rel of your container in order to reload. you can also place many selectors into the jQuery, see example below:
jQuery(document).ready(function () { jQuery(".gallery1 a, .gallery2 a").attr("rel","gallery1"); jQuery('a[rel="gallery1"], a[rel="gallery2"]').colorbox({title: function(){ return jQuery(this).children().attr("alt"); }}); });
Mobile Menu
Close your mobile menu. (Use google inspector to target the right class or ID to make it work)
$(".nav a").click(function () { $(".navbar-toggle").trigger('click'); // Trigger click on navbar-toggle to close it. });
The above code can be used to reload this feature before the page has been changed by ZAJAX.
Update current or active menu
Update current or active menu. (Use google inspector to target the right class or ID to make it work)
There's two ways to do this, just add the Zajax option to reload other content ID or Class (Chose your menu Class or ID)
$("#menu-top-menu li").click(function () { $("#menu-top-menu li").removeClass("current-menu-item"); $(this).addClass("current-menu-item"); });
The above code can be used to reload this feature before or after the page has been changed by ZAJAX.