Browse Source

src : add straightAcross layout mode; remove JSHint settings; v1.2.110520

pull/96/head
David DeSandro 14 years ago
parent
commit
93a5eba8d2
  1. 1
      _includes/layout-options.html
  2. 8
      _posts/docs/2010-12-05-layout-modes.mdown
  3. 36
      jquery.isotope.js
  4. 4
      jquery.isotope.min.js

1
_includes/layout-options.html

@ -8,4 +8,5 @@
<li><a href="#masonryHorizontal" class="horizontal">masonryHorizontal</a></li>
<li><a href="#fitColumns" class="horizontal">fitColumns</a></li>
<li><a href="#cellsByColumn" class="horizontal">cellsByColumn</a></li>
<li><a href="#straightAcross" class="horizontal">straightAcross</a></li>
</ul>

8
_posts/docs/2010-12-05-layout-modes.mdown

@ -12,6 +12,8 @@ toc:
- { title: fitRows, anchor: fitrows }
- { title: masonry, anchor: masonry }
- { title: masonryHorizontal, anchor: masonryhorizontal }
- { title: straightAcross, anchor: straightacross }
- { title: straightDown, anchor: straightdown }
- { title: Horizontal layouts, anchor: horizontal_layouts }
---
@ -152,13 +154,17 @@ $('#container').isotope({
{% endhighlight %}
## straightAcross
Item elements are arranged horizontally left to right. Useful for simple lists.
## straightDown
Item elements are arranged vertically top to bottom. Useful for simple lists.
## Horizontal layouts
Horizontal layout modes (masonryHorizontal, fitColumns, and cellsByColumn) need a container that has a height value. Be sure that your CSS has height set.
Horizontal layout modes (masonryHorizontal, fitColumns, cellsByColumn, and straightAcross) need a container that has a height value. Be sure that your CSS has height set.
{% highlight css %}

36
jquery.isotope.js

@ -1,5 +1,5 @@
/**
* Isotope v1.2.110516
* Isotope v1.2.110520
* An exquisite jQuery plugin for magical layouts
* http://isotope.metafizzy.co
*
@ -9,9 +9,6 @@
* Copyright 2011 David DeSandro / Metafizzy
*/
/*jshint forin: false */
/*global jQuery: true, Modernizr: true */
(function( window, $, undefined ){
// ========================= getStyleProperty by kangax ===============================
@ -1200,7 +1197,36 @@
this.reLayout();
}
return this;
}
},
// ====================== straightAcross ======================
_straightAcrossReset : function() {
this.straightAcross = {
x : 0
};
return this;
},
_straightAcrossLayout : function( $elems ) {
var instance = this;
$elems.each( function( i ){
var $this = $(this),
x = instance.straightAcross.x + instance.posLeft;
instance._pushPosition( $this, x, instance.posTop );
instance.straightAcross.x += $this.outerWidth(true);
});
return this;
},
_straightAcrossGetContainerSize : function() {
return { width : this.straightAcross.x + this.posLeft };
},
_straightAcrossResize : function() {
this.reLayout();
return this;
}
};

4
jquery.isotope.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save