WordPress.org

Ready to get started?Download WordPress

Forums

Infinite-Scroll
[resolved] Infinite Scroll and imagesLoaded (3 posts)

  1. throwingmarbles
    Member
    Posted 1 year ago #

    Hi,
    I've been trying to implement imagesLoaded in the Infinite Scroll script, but quite frankly don't know where to to start and none of my attempts have brought me any closer to a solution.

    I've altered the Manual Trigger behaviour so that it's suitable for Masonry/Isotope. My Isotope blocks contain images of various heights, so I need to first load those images before appending items, or else items end up overlapping.

    I'd greatly appreciate any pointers on how to combine Infinite Scroll with imagesLoaded.

    The imagesLoaded script:
    https://gist.github.com/desandro/797120

    Kindest regards,
    Marloes

    http://wordpress.org/extend/plugins/infinite-scroll/

  2. throwingmarbles
    Member
    Posted 1 year ago #

    This always happens, I mess around for days and nights without luck, finally pop the question online, try once more out of pure frustration and finally get it to work...

    I had to add the imagesLoaded call to Infinite Scroll as well as the Sampression theme scripts.js. In case anyone else searches, I edited this part in the behaviour script:

    _callback_masonry: function infscr_callback_masonry (newElements) {
    	$(this).imagesLoaded( function(){
    		$(this).masonry('appended',$(newElements));
    	});
    }
  3. sirjonathan
    Member
    Posted 1 year ago #

    Worked beautifully! And, for those wondering, with Infinite Scroll activated, the code above goes on the "Settings" page for the Infinite Scroll plugin in the "Callback" section.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic