code: function setMasonry() {
  		
  		var itemPerRow = 4;
  		var containerW = $container.width();
  		var items = $container.children('.hentry');
  		var columns, columnWidth;
  		var viewports = [ {
  				width : 1300,
  				columns : itemPerRow
  			}, {
  				width : 900,
  				columns : itemPerRow-1
  			}, {
  				width : 480,
  				columns : itemPerRow - 2
  			}, { 
  				width : 0,
  				columns : itemPerRow - 3
  			} ];
  	
  		for( var i = 0, len = viewports.length; i < len; ++i ) {
  	
  			var viewport = viewports[i];
  	
  			if( containerW > viewport.width ) {
  	
  				columns = viewport.columns;
  				break;
  	
  			}
  		}
  	
  		// set the widths (%) for each of item
  		items.each(function(index, element) {
  			var multiplier = $(this).hasClass('x2') && columns > 1 ? 2 : 1;
  			var itemWidth = (Math.floor( containerW / columns ) * 100 / containerW) * multiplier ;
  			$(this).css( 'width', itemWidth + '%' );
  		});
  	
  		columnWidth = Math.floor( containerW / columns );
  		$container.isotope( 'reLayout' ).isotope( 'option', { masonry: { columnWidth: columnWidth } } );
  	
  	}
docs: ------------------------------ PORTFOLIO MASONRY LAYOUT : change the number of masonry columns based on the current container's width