I am trying to get a callback function to execute when jQuery Masonry has done its positioning magic, preventing a flash of unstyled content in my code.
For the purpose of testing, though, I am using a simple alert that isn't called at all.
var $jigsaw = $('#jigsaw');
$jigsaw.imagesLoaded( function(){
$jigsaw.masonry({
columnWidth : 180,
isAnimated : !Modernizr.csstransitions,
isResizable : true,
itemSelector : '.piece'
}, function(){
alert('Completed');
});
});
I may be missing something obvious, but any help would be appreciated