(function ($){ $('#tiles').imagesLoaded(function() { // Prepare layout options. var options = { flexibleWidth : false, autoResize: false, // This will auto-update the layout when the browser window is resized. container: $('#main'), // Optional, used for some extra CSS styling offset: 2, // Optional, the distance between grid items itemWidth: 210, // Optional, the width of a grid item fillEmptySpace: true // Optional, fill the bottom of each column with widths of flexible height }; // Get a reference to your grid items. var handler = $('#tiles li'); // Call the layout function. handler.wookmark(options); }); })(jQuery);