Support » Plugin: I Recommend This » Any tips on making in work ok with Jetpack infinity scroll?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Solved.

    jQuery(document).ready(function($){
        $(document).on( 'ready post-load', function () {
            $('.dot-irecommendthis').unbind('click').bind("click",function() {
            		var link = $(this);
            		if(link.hasClass('active')) return false;
    
            		var id = $(this).attr('id'),
            			suffix = link.find('.dot-irecommendthis-suffix').text();
    
            		$.post(dot_irecommendthis.ajaxurl, { action:'dot-irecommendthis', recommend_id:id, suffix:suffix }, function(data){
            			link.html(data).addClass('active').attr('title','You already recommended this');
            		});
    
            		return false;
        	});
        });
    });

    Plugin Author Harish Chouhan

    (@hchouhan)

    Thanks @akis.

    Can you share your details with me so I will test this and give you credit when I update the plugin with your code.

    I basically used the events detailed here http://jetpack.me/support/infinite-scroll/#javascript-events, replaced live with bind because live is deprecated in the last version of jQuery and added unbind due to multiple triggers on each click (some conflict with infinte scroll).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Any tips on making in work ok with Jetpack infinity scroll?’ is closed to new replies.