php - Can't reload jQuery Masonry -


i got site shows 25 images. i've created button says "load more". buttons pull 25 images php script via ajax. part working fine. problem is, i'm using jquery masonry align images.

right now, calls masonry function when page loaded.

function masonry() {     var $container = $('#fit');     $container.imagesloaded(function () {         $container.masonry({             itemselector: '.masonryimage'         });     }); } 

however, when want call masonry() function afterwards, doesn't work.

if don't call masonry() on load, works fine in ajax function.

any ideas why happens?

calling bulk masonry() again after reload fixed issue me.

$('#fit').append(newitems).masonry('reloaditems').masonry(); 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -