Browse Source

Merge branch 'master' of github.com:desandro/isotope

Conflicts:
	_config.yml
pull/14/head
David DeSandro 14 years ago
parent
commit
e2510b41eb
  1. 4
      README.mdown
  2. 225
      _config.yml
  3. 3
      _includes/html-foot.html
  4. 2
      _includes/html-head.html
  5. 1
      _includes/layout-options.html
  6. 5
      _layouts/demo.html
  7. 8
      _layouts/doc.html
  8. 7
      _layouts/elements.html
  9. 9
      _layouts/inf-scroll-page.html
  10. 2
      _posts/demos/2010-12-12-basic.html
  11. 2
      _posts/demos/2010-12-29-layout-modes.html
  12. 2
      _posts/demos/2010-12-30-filtering.html
  13. 2
      _posts/demos/2010-12-30-sorting.html
  14. 2
      _posts/demos/2010-12-31-relayout.html
  15. 2
      _posts/demos/2011-01-02-adding-items.html
  16. 2
      _posts/demos/2011-01-02-infinite-scroll.html
  17. 2
      _posts/demos/2011-01-11-images.html
  18. 2
      _posts/docs/2010-12-01-introduction.mdown
  19. 84
      _posts/docs/2010-12-05-layout-modes.mdown
  20. 30
      css/style.css
  21. 12
      index.html
  22. 176
      jquery.isotope.js

4
README.mdown

@ -5,12 +5,12 @@ Isotope
This package has all the documentation and demos to get you started.
View this project live at ...
View this project live at [isotope.metafizzy.co](http://isotope.metafizzy.co)
Licensing
---------
**Commercial use requires purchase of one-time license fee per developer seat.** Commercial use includes any application that makes you money. This includes portfolio sites and premium templates. Commercial licenses may be purchased at [metafizzy.co](http://metafizzy.co).
**Commercial use requires purchase of one-time license fee per developer seat.** Commercial use includes any application that makes you money. This includes portfolio sites and premium templates. Commercial licenses may be purchased at [metafizzy.co](http://metafizzy.co#licenses).
Use in non-commercial and personal applications is free.

225
_config.yml

File diff suppressed because it is too large Load Diff

3
_includes/html-foot.html

@ -0,0 +1,3 @@
</body>
</html>

2
_includes/html-head.html

@ -4,6 +4,8 @@
<meta charset="utf-8" />
<title>{{ page.title }} &middot; {{ site.name }} {% if page.category == 'docs' %}Docs{% elsif page.category == 'demos' %}Demo{% endif %}</title>
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" />
<!-- scripts at bottom of page -->

1
_includes/layout-options.html

@ -4,6 +4,7 @@
<li><a href="#masonry" class="selected">masonry</a></li>
<li><a href="#fitRows">fitRows</a></li>
<li><a href="#cellsByRow">cellsByRow</a></li>
<li><a href="#straightDown">straightDown</a></li>
<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>

5
_layouts/demo.html

@ -1,6 +1,6 @@
{% include html-head.html %}
<p id="demo-nav"><a href="../">{{ site.name }}</a> Demo</p>
<p id="demo-nav"><a href="../index.html">{{ site.name }}</a> Demo</p>
<h1>{{ page.title }}</h1>
@ -8,5 +8,4 @@
{% include footer.html %}
</body>
</html>
{% include html-foot.html %}

8
_layouts/doc.html

@ -1,7 +1,7 @@
{% include html-head.html %}
<nav id="docs-nav">
<h1><a href="../">{{ site.name }}</a> Docs</h1>
<h1><a href="../index.html">{{ site.name }}</a> Docs</h1>
<ul>
{% for doc in site.categories.docs reversed %}
@ -31,8 +31,4 @@
</section> <!-- #content -->
</body>
</html>
{% include html-foot.html %}

7
_layouts/elements.html

@ -1,6 +1,6 @@
{% include html-head.html %}
<p id="demo-nav"><a href="../">{{ site.name }}</a> Demo</p>
<p id="demo-nav"><a href="../index.html">{{ site.name }}</a> Demo</p>
<h1>{{ page.title }}</h1>
@ -47,7 +47,7 @@
{% include footer.html %}
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
@ -145,5 +145,4 @@
</script>
</body>
</html>
{% include html-foot.html %}

9
_layouts/inf-scroll-page.html

@ -1,6 +1,6 @@
{% include html-head.html %}
<p id="demo-nav"><a href="../">{{ site.name }}</a> Demo</p>
<p id="demo-nav"><a href="../index.html">{{ site.name }}</a> Demo</p>
<h1>{{ page.title }}</h1>
@ -11,8 +11,10 @@
{% endfor %}
</div>
{% include footer.html %}
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){
@ -26,5 +28,4 @@
});
</script>
</body>
</html>
{% include html-foot.html %}

2
_posts/demos/2010-12-12-basic.html

@ -16,7 +16,7 @@ related: a-intro
</div> <!-- #container -->
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){

2
_posts/demos/2010-12-29-layout-modes.html

@ -23,7 +23,7 @@ related: layouts
</div> <!-- #container -->
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){

2
_posts/demos/2010-12-30-filtering.html

@ -30,7 +30,7 @@ related: filtering
</div> <!-- #container -->
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){

2
_posts/demos/2010-12-30-sorting.html

@ -23,7 +23,7 @@ related: sorting
</div> <!-- #container -->
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){

2
_posts/demos/2010-12-31-relayout.html

@ -23,7 +23,7 @@ related: methods
</div> <!-- #container -->
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){

2
_posts/demos/2011-01-02-adding-items.html

@ -25,7 +25,7 @@ related: methods
</div> <!-- #container -->
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
$(function(){

2
_posts/demos/2011-01-02-infinite-scroll.html

@ -21,7 +21,7 @@ infinite_scroll: true
</nav>
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/jquery.infinitescroll.min.js"></script>
<script>
$(function(){

2
_posts/demos/2011-01-11-images.html

@ -32,7 +32,7 @@ photos:
</nav>
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){

2
_posts/docs/2010-12-01-introduction.mdown

@ -23,7 +23,7 @@ toc:
+ [**Filtering**](filtering.html): Hide and reveal item elements easily with jQuery selectors.
+ [**Sorting**](sorting.html): Re-order item elements with sorting. Sorting data can be extracted from just about anything.
+ **Interoperability**: features can be utilized together for a cohesive experience.
+ **Progressive enhancement**: Isotope's [animation engine](animating.html) takes advantage of CSS transitions and transforms when available, but will also fall back to Javascript animation for lesser browsers.
+ **Progressive enhancement**: Isotope's [animation engine](animating.html) takes advantage of the best browser features when available &mdash; CSS transitions and transforms, GPU acceleration &mdash; but will also fall back to JavaScript animation for lesser browsers.
## Licensing

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

@ -6,12 +6,12 @@ layout: doc
body_class: option-def
related: layout
toc:
- { title: masonry, anchor: masonry }
- { title: fitRows, anchor: fitrows }
- { title: cellsByColumn, anchor: cellsbycolumn }
- { title: cellsByRow, anchor: cellsbyrow }
- { title: masonryHorizontal, anchor: masonryhorizontal }
- { title: fitColumns, anchor: fitcolumns }
- { title: cellsByColumn, anchor: cellsbycolumn }
- { title: fitRows, anchor: fitrows }
- { title: masonry, anchor: masonry }
- { title: masonryHorizontal, anchor: masonryhorizontal }
- { title: Horizontal layouts, anchor: horizontal_layouts }
---
@ -28,36 +28,37 @@ $('#container').isotope({ layoutMode : 'fitRows' });
{% endhighlight %}
Six layout modes are built into Isotope.
Several layout modes are built into Isotope.
## masonry
## cellsByColumn
masonry is the default layout mode for Isotope. Item elements are arranged intelligently within a grid. For each item element, the script calculates the next best fit for the item within the grid.
A grid layout where items are centered inside each cell. The grid is defined by two options, `columnWidth` and `rowHeight`. The horizontal equivalent of cellsByRow.
### Options {#masonry-options}
### Options {#cellsByColumn-options}
<dl class="clearfix">
<dt><code>columnWidth</code></dt>
<dd class="option-type">Integer</dd>
</dl>
<dl class="clearfix">
<dt><code>rowHeight</code></dt>
<dd class="option-type">Integer</dd>
</dl>
The width of one column in the grid. If no value is set for `columnWidth`, default is the width of the first item element.
### Example {#masonry-example}
### Example {#cellsByColumn-example}
{% highlight javascript %}
$('#container').isotope({
masonry : {
columnWidth : 240
layoutMode : 'cellsByRow',
cellsByRow : {
columnWidth : 240,
rowHeight : 360
}
});
{% endhighlight %}
## fitRows
Item elements are arranged into rows. Similar to what you would expect from a layout that uses `float: left`
## cellsByRow
@ -88,64 +89,73 @@ $('#container').isotope({
{% endhighlight %}
## masonryHorizontal
## fitColumns
The horizontal equivalent of masonry layout. Instead of progressing top-to-bottom, masonryHorizontal layout will progress left-to-right. Item elements are arranged intelligently within a grid. For each item element, the script calculates the next best fit for the item within the grid.
Item elements are arranged into columns. The horizontal equivalent of fitRows. Columns progress from left to right. Items within those columns are arranged top-to-bottom.
### Options {#masonryHorizontal-options}
## fitRows
Item elements are arranged into rows, left to right. Rows progress top to bottom. Similar to what you would expect from a layout that uses `float: left`.
## masonry
masonry is the default layout mode for Isotope. Item elements are arranged intelligently within a grid. For each item element, the script calculates the next best fit for the item within the grid.
### Options {#masonry-options}
<dl class="clearfix">
<dt><code>rowHeight</code></dt>
<dt><code>columnWidth</code></dt>
<dd class="option-type">Integer</dd>
</dl>
The width of one column in the grid. If no value is set for `rowHeight`, default is the height of the first item element.
The width of one column in the grid. If no value is set for `columnWidth`, default is the width of the first item element.
### Example {#masonryHorizontal-example}
### Example {#masonry-example}
{% highlight javascript %}
$('#container').isotope({
masonryHorizontal : {
rowHeight : 360
masonry : {
columnWidth : 240
}
});
{% endhighlight %}
## fitColumns
Item elements are arranged into columns. The horizontal equivalent of fitRows. Columns progress from left to right. Items within those columns are arranged top-to-bottom.
## cellsByColumn
A grid layout where items are centered inside each cell. The grid is defined by two options, `columnWidth` and `rowHeight`. The horizontal equivalent of cellsByRow.
### Options {#cellsByColumn-options}
<dl class="clearfix">
<dt><code>columnWidth</code></dt>
<dd class="option-type">Integer</dd>
</dl>
## masonryHorizontal
The horizontal equivalent of masonry layout. Instead of progressing top-to-bottom, masonryHorizontal layout will progress left-to-right. Item elements are arranged intelligently within a grid. For each item element, the script calculates the next best fit for the item within the grid.
### Options {#masonryHorizontal-options}
<dl class="clearfix">
<dt><code>rowHeight</code></dt>
<dd class="option-type">Integer</dd>
</dl>
### Example {#cellsByColumn-example}
The width of one column in the grid. If no value is set for `rowHeight`, default is the height of the first item element.
### Example {#masonryHorizontal-example}
{% highlight javascript %}
$('#container').isotope({
layoutMode : 'cellsByRow',
cellsByRow : {
columnWidth : 240,
masonryHorizontal : {
rowHeight : 360
}
});
{% endhighlight %}
## 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.

30
css/style.css

@ -77,23 +77,23 @@ body {
height: 110px;
margin: 5px;
float: left;
background: white;
overflow: hidden;
position: relative;
background: #888;
color: #222;
border-top-right-radius: 1.2em;
}
.element.alkali { background-color: hsl( 0, 100%, 50%); }
.element.alkaline-earth { background-color: hsl( 36, 100%, 50%); }
.element.lanthanoid { background-color: hsl( 72, 100%, 50%); }
.element.actinoid { background-color: hsl( 108, 100%, 50%); }
.element.transition { background-color: hsl( 144, 100%, 50%); }
.element.post-transition { background-color: hsl( 180, 100%, 50%); }
.element.metalloid { background-color: hsl( 216, 100%, 50%); }
.element.other.nonmetal { background-color: hsl( 252, 100%, 50%); }
.element.halogen { background-color: hsl( 288, 100%, 50%); }
.element.noble-gas { background-color: hsl( 324, 100%, 50%); }
.element.alkali { background: #F00; background: hsl( 0, 100%, 50%); }
.element.alkaline-earth { background: #F80; background: hsl( 36, 100%, 50%); }
.element.lanthanoid { background: #FF0; background: hsl( 72, 100%, 50%); }
.element.actinoid { background: #0F0; background: hsl( 108, 100%, 50%); }
.element.transition { background: #0F8; background: hsl( 144, 100%, 50%); }
.element.post-transition { background: #0FF; background: hsl( 180, 100%, 50%); }
.element.metalloid { background: #08F; background: hsl( 216, 100%, 50%); }
.element.other.nonmetal { background: #00F; background: hsl( 252, 100%, 50%); }
.element.halogen { background: #F0F; background: hsl( 288, 100%, 50%); }
.element.noble-gas { background: #F08; background: hsl( 324, 100%, 50%); }
.element * {
@ -586,17 +586,17 @@ code .nd { color: #9FAD7E; } /* CSS pseudo selector */
}
#super-list li a {
color: #222;
/* font-weight: bold;*/
}
#super-list li.doc a { background: #3CF; }
#super-list li.demo a { background: #FC3; }
#super-list li.link a { background: #E58; color: white; }
#super-list li a:hover,
#super-list li a.doc:hover,
#super-list li a.demo:hover {
#super-list li a:hover {
background: white;
}
#super-list li.link a:hover { color: #222; }
#super-list.masonry li {
width: 216px;
}

12
index.html

@ -47,7 +47,7 @@ layout: nil
<li><a href="#show-all" data-filter="*" class="selected">show all</a></li>
<li><a href="#features" data-filter=".feature">features</a></li>
<li><a href="#docs" data-filter=".doc">docs</a></li>
<li><a href="#containers" data-filter=".demo">demos</a></li>
<li><a href="#demos" data-filter=".demo">demos</a></li>
</ul>
</div>
<div class="option-combo">
@ -62,7 +62,7 @@ layout: nil
<h2>Layout: </h2>
<ul id="layouts" class="option-set floated clearfix">
<li><a href="#fitRows" class="selected">fitRows</a></li>
<li><a href="#verticalList">verticalList</a></li>
<li><a href="#straightDown">straightDown</a></li>
<li><a href="#masonry">masonry</a></li>
</ul>
</div>
@ -84,13 +84,16 @@ layout: nil
{% for demo in site.categories.demos reversed %}
<li class="demo" data-category="demo" data-related="{{ demo.related }}"><a href=".{{ demo.url }}">Demo: {{ demo.title }}</a></li>
{% endfor %}
<li class="link" data-related="z-etc"><a href="jquery.isotope.min.js">Download jquery.isotope.min.js</a></li>
<li class="link" data-related="z-etc"><a href="#">Download this project</a></li>
<li class="link" data-related="z-etc"><a href="http://github.com/desandro/isotope">Isotope on GitHub</a></li>
</ul>
{% include footer.html %}
<script src="js/jquery-1.4.4.min.js"></script>
<script src="jquery.isotope.js"></script>
<script src="{{ site.isotope_js }}"></script>
<script>
$(function(){
@ -138,5 +141,4 @@ layout: nil
});
</script>
</body>
</html>
{% include html-foot.html %}

176
jquery.isotope.js

@ -1,7 +1,11 @@
/**
* Isotope v0.1
* An exquisite jQuery plugin for magical layouts
* http://desandro.com/resources/isotope
* http://isotope.metafizzy.co
*
* Commercial use requires one-time license fee
* http://metafizzy.co/#licenses
*
* Copyright 2011 David DeSandro / Metafizzy
*/
@ -18,14 +22,15 @@ var getStyleProperty = (function(){
element = element || document.documentElement;
var style = element.style,
prefixed,
uPropName;
uPropName,
i, l;
// check cache only when no element is given
if (arguments.length == 1 && typeof _cache[propName] == 'string') {
if (arguments.length === 1 && typeof _cache[propName] === 'string') {
return _cache[propName];
}
// test standard property first
if (typeof style[propName] == 'string') {
if (typeof style[propName] === 'string') {
return (_cache[propName] = propName);
}
@ -33,16 +38,16 @@ var getStyleProperty = (function(){
uPropName = propName.charAt(0).toUpperCase() + propName.slice(1);
// test vendor specific properties
for (var i=0, l=prefixes.length; i<l; i++) {
for (i=0, l=prefixes.length; i<l; i++) {
prefixed = prefixes[i] + uPropName;
if (typeof style[prefixed] == 'string') {
if (typeof style[prefixed] === 'string') {
return (_cache[propName] = prefixed);
}
}
}
return getStyleProperty;
})();
}());
// ========================= miniModernizr ===============================
// <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting
@ -62,24 +67,8 @@ var getStyleProperty = (function(){
/*
* Modernizr is a script that detects native CSS3 and HTML5 features
* available in the current UA and provides an object containing all
* features with a true/false value, depending on whether the UA has
* native support for it or not.
*
* Modernizr will also add classes to the <html> element of the page,
* one for each feature it detects. If the UA supports it, a class
* like "cssgradients" will be added. If not, the class name will be
* "no-cssgradients". This allows for simple if-conditionals in your
* CSS, giving you fine control over the look & feel of your website.
*
* This version whittles down the script just to check support for
* CSS transitions, transforms, and 3D transforms.
*
* @author Faruk Ates
* @author Paul Irish
* @copyright (c) 2009-2010 Faruk Ates.
* @contributor Ben Alman
*/
window.Modernizr = window.Modernizr || (function(window,doc,undefined){
@ -89,6 +78,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
classes = [],
docElement = document.documentElement,
i, l,
tests = [
{
@ -131,7 +121,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
// Run through all tests and detect their support in the current UA.
for ( var i = 0, len = tests.length; i < len; i++ ) {
for ( i = 0, len = tests.length; i < len; i++ ) {
var test = tests[i],
result = test.result();
miniModernizr[ test.name ] = result;
@ -144,7 +134,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
return miniModernizr;
})(this,this.document);
}(this,this.document));
@ -165,7 +155,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
transformProp : getStyleProperty('transform'),
fnUtils : Modernizr.csstransforms3d ?
{ // 2d transform functions
{ // 3D transform functions
translate : function ( position ) {
return 'translate3d(' + position[0] + 'px, ' + position[1] + 'px, 0) ';
},
@ -173,7 +163,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
return 'scale3d(' + scale + ', ' + scale + ', 1) ';
}
} :
{ // 3d transform functions
{ // 2D transform functions
translate : function ( position ) {
return 'translate(' + position[0] + 'px, ' + position[1] + 'px) ';
},
@ -231,14 +221,14 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
value = parseFloat( value );
}
$.isoTransform.set( elem, 'scale', value )
$.isoTransform.set( elem, 'scale', value );
},
get: function( elem, computed ) {
var transform = $.data( elem, 'transform' );
return transform && transform.scale ? transform.scale : 1;
}
}
};
$.fx.step.scale = function( fx ) {
$.cssHooks.scale.set( fx.elem, fx.now+fx.unit );
@ -268,7 +258,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
// }
// }
$.isoTransform.set( elem, 'translate', value )
$.isoTransform.set( elem, 'translate', value );
},
@ -276,7 +266,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
var transform = $.data( elem, 'transform' );
return transform && transform.translate ? transform.translate : [ 0, 0 ];
}
}
};
@ -425,7 +415,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
// bind resize method
if ( this.options.resizable ) {
$(window).bind( 'smartresize.isotope', function() {
instance.element.isotope('resize')
instance.element.isotope('resize');
});
}
@ -449,7 +439,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
});
if ( this.isNew.filter ) {
this.$filteredAtoms = this._filter( this.$allAtoms )
this.$filteredAtoms = this._filter( this.$allAtoms );
} else {
this.$filteredAtoms = this.$allAtoms;
}
@ -642,9 +632,8 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
reLayout : function( callback ) {
return this
[ '_' + this.options.layoutMode + 'Reset' ]()
.layout( this.$filteredAtoms, callback )
return this[ '_' + this.options.layoutMode + 'Reset' ]()
.layout( this.$filteredAtoms, callback );
},
// ====================== Convenience methods ======================
@ -681,7 +670,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
var instance = this;
this.addItems( $content, function( $newAtoms ){
instance.$filteredAtoms = instance.$filteredAtoms.add( $newAtoms );
instance.layout( $newAtoms, callback )
instance.layout( $newAtoms, callback );
});
},
@ -761,7 +750,7 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
// if colW == 0, back out before divide by zero
if ( !this[ namespace ][ measure ] ) {
$.error( measure + ' calculated to be zero. Stopping Isotope plugin before divide by zero. Check that the width of first child inside the isotope container is not zero.')
$.error( measure + ' calculated to be zero. Stopping Isotope plugin before divide by zero. Check that the width of first child inside the isotope container is not zero.');
return this;
}
this[ size ] = this.element[ size ]();
@ -822,10 +811,11 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
// how many different places could this brick fit horizontally
var groupCount = instance.masonry.cols + 1 - colSpan,
groupY = [],
groupColY;
groupColY,
i;
// for each group potential horizontal position
for ( var i=0; i < groupCount; i++ ) {
for ( i=0; i < groupCount; i++ ) {
// make an array of colY values for that one group
groupColY = instance.masonry.colYs.slice( i, i+colSpan );
// and get the max value of the array
@ -956,31 +946,31 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
},
// ====================== verticalList ======================
// ====================== straightDown ======================
_verticalListReset : function() {
this.verticalList = {
_straightDownReset : function() {
this.straightDown = {
y : 0
};
return this;
},
_verticalListLayout : function( $elems ) {
_straightDownLayout : function( $elems ) {
var instance = this;
$elems.each( function( i ){
var $this = $(this),
y = instance.verticalList.y + instance.posTop;
y = instance.straightDown.y + instance.posTop;
instance._pushPosition( $this, instance.posLeft, y );
instance.verticalList.y += $this.outerHeight(true)
instance.straightDown.y += $this.outerHeight(true)
});
return this;
},
_verticalListGetContainerSize : function() {
return { height : this.verticalList.y + this.posTop };
_straightDownGetContainerSize : function() {
return { height : this.straightDown.y + this.posTop };
},
_verticalListResize : function() {
_straightDownResize : function() {
this.reLayout();
return this;
},
@ -1216,50 +1206,50 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
$.widget = $.widget || {};
$.widget.bridge = $.widget.bridge || function( name, object ) {
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = Array.prototype.slice.call( arguments, 1 ),
returnValue = this;
// allow multiple hashes to be passed on init
options = !isMethodCall && args.length ?
$.extend.apply( null, [ true, options ].concat(args) ) :
options;
// prevent calls to internal methods
if ( isMethodCall && options.charAt( 0 ) === "_" ) {
return returnValue;
}
if ( isMethodCall ) {
this.each(function() {
var instance = $.data( this, name );
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
}
if ( !$.isFunction( instance[options] ) ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
var methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue;
return false;
}
});
} else {
this.each(function() {
var instance = $.data( this, name );
if ( instance ) {
instance.option( options || {} )._init();
} else {
$.data( this, name, new object( options, this ) );
}
});
}
return returnValue;
};
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = Array.prototype.slice.call( arguments, 1 ),
returnValue = this;
// allow multiple hashes to be passed on init
options = !isMethodCall && args.length ?
$.extend.apply( null, [ true, options ].concat(args) ) :
options;
// prevent calls to internal methods
if ( isMethodCall && options.charAt( 0 ) === "_" ) {
return returnValue;
}
if ( isMethodCall ) {
this.each(function() {
var instance = $.data( this, name );
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
}
if ( !$.isFunction( instance[options] ) ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
var methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue;
return false;
}
});
} else {
this.each(function() {
var instance = $.data( this, name );
if ( instance ) {
instance.option( options || {} )._init();
} else {
$.data( this, name, new object( options, this ) );
}
});
}
return returnValue;
};
};

Loading…
Cancel
Save