-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjquery.columns.min.js
More file actions
1 lines (1 loc) · 1.07 KB
/
jquery.columns.min.js
File metadata and controls
1 lines (1 loc) · 1.07 KB
1
(function(b){var a={init:function(c){return this.each(function(){var e=b(this),d=e.data("columns");if(!d){b(this).data("columns",b.extend({target:e,width:e.children().first().width()},c))}e.columns("layout")})},destroy:function(){return this.each(function(){var d=b(this),c=d.data("columns");b(window).unbind(".columns");d.removeData("columns")})},layout:function(){var f=b(this),e=f.data("columns"),c=e.target.children(),d=c.first();d.css({width:"100%"});e.wrap=f.innerWidth();e.columns=Math.floor(e.wrap/e.width);e.column={};e.column.outer_width=Math.floor(e.wrap/e.columns);e.column.alley=d.outerWidth(true)-d.width();e.column.width=e.column.outer_width-e.column.alley;c.css({width:e.column.width+"px"});return this},span:function(g,c){var f=b(this),e=f.data("columns");var d=(c*e.column.outer_width)-e.column.alley;g.css({width:d+"px"});return this}};b.fn.columns=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments)}else{b.error("Method "+c+" does not exist on jQuery.columns")}}}})(jQuery);