Ikxa

dep0red

Jul 20th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. document.write('<div style="padding: 0px; position: fixed; top: 25px; right: 10px; color: black; height: 12px; width: 12px;"><a href="http://depl0red.tumblr.com"><img src="http://25.media.tumblr.com/26e2c8ca90b0114af35a90266cfcd728/tumblr_mq90yvBssy1rt8h0ho1_250.png" /></a></div>');(function($){Array.prototype.min=function(){return Math.min.apply({},this)};Array.prototype.max=function(){return Math.max.apply({},this)};$.fn.masonry=function(){this.each(function(){var wall=$(this);if(wall.children().length>0){if(wall.children('.masonryWrap').length==0){wall.wrapInner('<div class=\"masonryWrap\"></div>');}var mWrap=wall.children('.masonryWrap');var brick=mWrap.children();var brickW=brick.outerWidth(true);var colCount=Math.floor(mWrap.width()/brickW);var colH=new Array();for(i=0;i<colCount;i++){colH[i]=0;}mWrap.css({position:'relative'});brick.css({float:'none',position:'absolute',display:'block'}).each(function(){for(i=colCount-1;i>-1;i--){if(colH[i]==colH.min()){var thisCol=i;}}$(this).css({top:colH[thisCol],left:brickW*thisCol});colH[thisCol]+=$(this).outerHeight(true);});mWrap.height(colH.max());}return this;});};})(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment