diff --git a/example/index.html b/example/index.html index e2684a7..1606beb 100755 --- a/example/index.html +++ b/example/index.html @@ -82,7 +82,7 @@

jQuery Wookmark Plug-in Example

$(document).ready(new function() { // Prepare layout options. var options = { - autoResize: false, // This will auto-update the layout when the browser window is resized. + autoResize: true, // 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: 202 // Optional, the width of a grid item diff --git a/jquery.wookmark.min.js b/jquery.wookmark.min.js new file mode 100644 index 0000000..8293300 --- /dev/null +++ b/jquery.wookmark.min.js @@ -0,0 +1,11 @@ +/*! + jQuery Wookmark plugin 0.3 + @name jquery.wookmark.js + @author Christoph Ono (chri@sto.ph or @gbks) + @version 0.3 + @date 2/10/2012 + @category jQuery plugin + @copyright (c) 2009-2012 Christoph Ono (www.wookmark.com) + @license Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. +*/ +$.fn.wookmark=function(a){this.wookmarkOptions={};if(a){this.wookmarkOptions=a}var b={container:$("body"),offset:2,autoResize:false,itemWidth:$(this[0]).outerWidth(),resizeDelay:50};for(var c in b){if(!this.wookmarkOptions[c]){this.wookmarkOptions[c]=b[c]}}if(!this.wookmarkColumns){this.wookmarkColumns=null;this.wookmarkContainerWidth=null}this.wookmarkLayout=function(){var a=this.wookmarkOptions.itemWidth+this.wookmarkOptions.offset;var b=this.wookmarkOptions.container.width();var c=Math.floor((b+this.wookmarkOptions.offset)/a);var d=Math.round((b-(c*a-this.wookmarkOptions.offset))/2);var e=0;if(this.wookmarkColumns!=null&&this.wookmarkColumns.length==c){e=this.wookmarkLayoutColumns(a,d)}else{e=this.wookmarkLayoutFull(a,c,d)}this.wookmarkOptions.container.css("height",e+"px")};this.wookmarkLayoutFull=function(a,b,c){var d=[];while(d.length