• Resolved timdenty

    (@timdenty)


    Hi – I have a page containing multiple instances of Ajax Load More listings.

    In each instance, the load more button container (alm-btn-wrap) is styled with a gradient ‘fade to white’ directly over a shortened nth post. I then have a callback on complete to hide the load more button container, and reset the nth post height:

    $.fn.almComplete = function(alm){
    	$('.alm-btn-wrap').fadeOut();
    	$('.panel_case_studies > .case_study_overview:nth-child(3)').css('height','auto');
    };

    The problem being that the button containers & nth posts for ALL instances are affected when only one is clicked.

    How can I go about targeting the appropriate instance only?

    Thx

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    HI @timdenty,
    In the almComplete callback, the alm variable contains info about the current instance and you can use that to target the instance.

    $.fn.almComplete = function(alm){
       console.log(alm);
       console.log(alm.el); // <- Current div
    };
    Thread Starter timdenty

    (@timdenty)

    Ah. Perfect, thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multiple instances – defining targets’ is closed to new replies.