first import
This commit is contained in:
238
sites/all/libraries/isotope-site/docs/adding-items.html
Normal file
238
sites/all/libraries/isotope-site/docs/adding-items.html
Normal file
@@ -0,0 +1,238 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Adding items · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Adding items</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#additems_method">addItems method</a></li>
|
||||
|
||||
<li><a href="#insert_method">insert method</a></li>
|
||||
|
||||
<li><a href="#appended_method">appended method</a></li>
|
||||
|
||||
<li><a href="#prepending">Prepending</a></li>
|
||||
|
||||
<li><a href="#recommended_css">Recommended CSS</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Adding items</h1>
|
||||
|
||||
|
||||
<p>If your application dynamically adds new content, Isotope provides several methods to add items.</p>
|
||||
|
||||
<p><a href='../demos/adding-items.html'><strong>See Demo: Adding items</strong></a>.</p>
|
||||
|
||||
<h2 id='additems_method'>addItems method</h2>
|
||||
|
||||
<p>The <a href='methods.html#additems'><code>addItems</code> method</a> adds new content to an Isotope container. This applies the proper styles to the items so they can be positioned and any sorting data is retrieved. But that’s it. The new content will <em>not</em> be filtered, sorted, or positioned properly, nor will it be appended to the container element.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='kd'>var</span> <span class='nx'>$newItems</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='s1'>'<div class="item" /><div class="item" /><div class="item" />'</span><span class='p'>);</span>
|
||||
<span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>append</span><span class='p'>(</span> <span class='nx'>$newItems</span> <span class='p'>).</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'addItems'</span><span class='p'>,</span> <span class='nx'>$newItems</span> <span class='p'>);</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='insert_method'>insert method</h2>
|
||||
|
||||
<p>More likely, you want to use the <a href='methods.html#insert'><code>insert</code> method</a>, which does everything that <code>addItems</code> misses. <code>insert</code> will append the content to the container, filter the new content, sort all the content, then trigger a <code>reLayout</code> so all item elements are properly laid out.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='kd'>var</span> <span class='nx'>$newItems</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='s1'>'<div class="item" /><div class="item" /><div class="item" />'</span><span class='p'>);</span>
|
||||
<span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'insert'</span><span class='p'>,</span> <span class='nx'>$newItems</span> <span class='p'>);</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='appended_method'>appended method</h2>
|
||||
|
||||
<p>The <a href='methods.html#appended'><code>appended</code> method</a> is a convenience method triggers <code>addItems</code> on new content, then lays out <em>only the new content</em> at the end of the layout. This method is useful if you know you only want to add new content to the end, and <strong>not</strong> use filtering or sorting. <code>appended</code> is the best method to use with Infinite Scroll.</p>
|
||||
|
||||
<p><a href='../demos/infinite-scroll.html'><strong>See Demo: Infinite Scroll</strong></a>.</p>
|
||||
|
||||
<p>See also <a href='help.html#infinite_scroll_with_filtering_or_sorting'>Infinite Scroll with filtering or sorting</a></p>
|
||||
|
||||
<h2 id='prepending'>Prepending</h2>
|
||||
|
||||
<p>Because of Isotope’s sorting functionality, prepending isn’t as straight forward as might expect. However, it can be replicated fairly easy. After prepending new content to the container, you can re-collect all the item elements and update their sorting order with the <a href='methods.html#reloaditems'><code>reloadItems</code> method</a>. Then trigger a re-layout, with the original DOM order.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='kd'>var</span> <span class='nx'>$newItems</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='s1'>'<div class="item" /><div class="item" /><div class="item" />'</span><span class='p'>);</span>
|
||||
<span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>prepend</span><span class='p'>(</span> <span class='nx'>$newItems</span><span class='p'>)</span>
|
||||
<span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'reloadItems'</span> <span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span> <span class='nx'>sortBy</span><span class='o'>:</span> <span class='s1'>'original-order'</span> <span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='recommended_css'>Recommended CSS</h2>
|
||||
|
||||
<p>You’ll need these styles in your CSS for the reveal animation when adding items.</p>
|
||||
<div class='highlight'><pre><code class='css'><span class='c'>/**** disabling Isotope CSS3 transitions ****/</span>
|
||||
|
||||
<span class='nc'>.isotope.no-transition</span><span class='o'>,</span>
|
||||
<span class='nc'>.isotope.no-transition</span> <span class='nc'>.isotope-item</span><span class='o'>,</span>
|
||||
<span class='nc'>.isotope</span> <span class='nc'>.isotope-item.no-transition</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0s</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0s</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0s</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
265
sites/all/libraries/isotope-site/docs/animating.html
Normal file
265
sites/all/libraries/isotope-site/docs/animating.html
Normal file
@@ -0,0 +1,265 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Animating · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Animating</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#animationengine_option">animationEngine option</a></li>
|
||||
|
||||
<li><a href="#css_transitions">CSS transitions</a></li>
|
||||
|
||||
<li><a href="#variations">Variations</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Animating</h1>
|
||||
|
||||
|
||||
<p>Isotope was developed to take advantage of the best browser features available. For animations, you can use CSS3 transitions and transforms in capable browsers. Isotope provides Javascript animation fall back for lesser browsers.</p>
|
||||
|
||||
<h2 id='animationengine_option'>animationEngine option</h2>
|
||||
|
||||
<p>You can control how Isotope handles animation with the <a href='options.html#animationengine'><code>animationEngine</code></a> option. This option has three values which control whether jQuery applies styles with<code>.css()</code> or <code>.animate()</code>.</p>
|
||||
|
||||
<ul>
|
||||
<li><code>'best-available'</code>: if browser supports CSS transitions, Isotope uses <code>.css()</code>. If not, falls back to using <code>.animate()</code>.</li>
|
||||
|
||||
<li><code>'css'</code>: Isotope uses <code>.css()</code></li>
|
||||
|
||||
<li><code>'jquery'</code>: Isotope uses <code>.animate()</code></li>
|
||||
</ul>
|
||||
|
||||
<h2 id='css_transitions'>CSS transitions</h2>
|
||||
|
||||
<p>To enable animation with CSS transitions, you’ll need the following code in your CSS:</p>
|
||||
<div class='highlight'><pre><code class='css'><span class='nc'>.isotope</span><span class='o'>,</span>
|
||||
<span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='c'>/* change duration value to whatever you like */</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0.8s</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0.8s</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0.8s</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='nc'>.isotope</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>height</span><span class='o'>,</span> <span class='k'>width</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>height</span><span class='o'>,</span> <span class='k'>width</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>height</span><span class='o'>,</span> <span class='k'>width</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='variations'>Variations</h2>
|
||||
|
||||
<p>With these two options you can finely control how animation is handled across browsers.</p>
|
||||
|
||||
<h3 id='best_available_recommended'>Best available (recommended)</h3>
|
||||
|
||||
<p>Browsers that support CSS transitions will use them. Other browsers will fall back to using jQuery animation.</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Add</strong> CSS transition declarations</li>
|
||||
</ul>
|
||||
|
||||
<h3 id='always_use_jquery'>Always use jQuery</h3>
|
||||
|
||||
<p>All browsers will use jQuery animation, regardless of their CSS transition support.</p>
|
||||
|
||||
<ul>
|
||||
<li><code>animationEngine : 'jquery'</code></li>
|
||||
|
||||
<li><strong>No</strong> CSS transition declarations</li>
|
||||
</ul>
|
||||
|
||||
<p>Never set <code>animationEngine : 'jquery'</code> AND add CSS transition declarations. This will cause double-animation in browser that support CSS transitions — which is a bad thing.</p>
|
||||
|
||||
<h3 id='only_css_transitions'>Only CSS transitions</h3>
|
||||
|
||||
<ul>
|
||||
<li><code>animationEngine: 'css'</code></li>
|
||||
|
||||
<li><strong>Add</strong> CSS transition declarations</li>
|
||||
</ul>
|
||||
|
||||
<h3 id='none'>None</h3>
|
||||
|
||||
<p>Animation is not enabled in any browser</p>
|
||||
|
||||
<ul>
|
||||
<li><code>animationEngine : 'css'</code></li>
|
||||
|
||||
<li><strong>No</strong> CSS transition declarations</li>
|
||||
</ul>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
312
sites/all/libraries/isotope-site/docs/extending-isotope.html
Normal file
312
sites/all/libraries/isotope-site/docs/extending-isotope.html
Normal file
@@ -0,0 +1,312 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Extending Isotope · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Extending Isotope</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#custom_layout_modes">Custom layout modes</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Extending Isotope</h1>
|
||||
|
||||
|
||||
<p>Isotope uses a constructor pattern, <code>$.Isotope</code>. To extend Isotope, you need only to add a method to <code>$.Isotope.prototype</code>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>.</span><span class='nx'>Isotope</span><span class='p'>.</span><span class='nx'>prototype</span><span class='p'>.</span><span class='nx'>myMethod</span> <span class='o'>=</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span> <span class='p'>...</span> <span class='p'>};</span>
|
||||
|
||||
<span class='c1'>// or, using jQuery extend utility</span>
|
||||
<span class='nx'>$</span><span class='p'>.</span><span class='nx'>extend</span><span class='p'>(</span> <span class='nx'>$</span><span class='p'>.</span><span class='nx'>Isotope</span><span class='p'>.</span><span class='nx'>prototype</span><span class='p'>,</span> <span class='p'>{</span>
|
||||
<span class='nx'>myMethod</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span> <span class='p'>...</span> <span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Before diving in, try <a href='../jquery.isotope.js'>looking over the source</a> to get a better understand of the internal logic behind Isotope.</p>
|
||||
|
||||
<h2 id='custom_layout_modes'>Custom layout modes</h2>
|
||||
|
||||
<p>Isotope’s layout modes are built around four methods: <code>Reset</code>, <code>Layout</code>, <code>GetContainerSize</code>, and <code>ResizeChanged</code>. These methods are the hooks that allow you to develop your own custom layout mode, without getting your hands dirty dealing with sorting, filtering, or other functionality. These layout mode methods need to be prefixed with an underscore and the name of the layout mode.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='c1'>// adding layout mode methods for 'customMode'</span>
|
||||
<span class='nx'>$</span><span class='p'>.</span><span class='nx'>extend</span><span class='p'>(</span> <span class='nx'>$</span><span class='p'>.</span><span class='nx'>Isotope</span><span class='p'>.</span><span class='nx'>prototype</span><span class='p'>,</span> <span class='p'>{</span>
|
||||
<span class='nx'>_customModeReset</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span> <span class='p'>...</span> <span class='p'>},</span>
|
||||
<span class='nx'>_customModeLayout</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>$elems</span> <span class='p'>)</span> <span class='p'>{</span> <span class='p'>...</span> <span class='p'>},</span>
|
||||
<span class='nx'>_customModeGetContainerSize</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span> <span class='p'>...</span> <span class='p'>},</span>
|
||||
<span class='nx'>_customModeResizeChanged</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span> <span class='p'>...</span> <span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p><a href='../custom-layout-modes/category-rows.html'><strong>See Custom layout mode: Category Rows</strong></a> <a href='../custom-layout-modes/spine-align.html'><strong>See Custom layout mode: Spine align</strong></a></p>
|
||||
|
||||
<p>All of the <a href='../docs/layout-modes.html'>default layout modes</a> follow this pattern. We’ll look at the code behind the <em>fitRows</em> layout mode.</p>
|
||||
|
||||
<h3 id='reset'>Reset</h3>
|
||||
|
||||
<p>Each layout mode should have its own set of properties that only it can use and not be affected by other layout modes. These properties can be accessed in the instance as an object whose value matches the layout mode name (i.e. <code>this.fitRows</code> for <em>fitRows</em>).</p>
|
||||
|
||||
<p>The <code>Reset</code> layout mode method is called with every <code>reLayout</code>, where Isotope will go through each item element and position it. This method resets layout mode properties.</p>
|
||||
|
||||
<p>The <em>fitRows</em> layout mode keeps track of x and y position, as well as the height of the container. These properties are set back to zero in <code>Reset</code>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>_fitRowsReset</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span>
|
||||
<span class='k'>this</span><span class='p'>.</span><span class='nx'>fitRows</span> <span class='o'>=</span> <span class='p'>{</span>
|
||||
<span class='nx'>x</span> <span class='o'>:</span> <span class='mi'>0</span><span class='p'>,</span>
|
||||
<span class='nx'>y</span> <span class='o'>:</span> <span class='mi'>0</span><span class='p'>,</span>
|
||||
<span class='nx'>height</span> <span class='o'>:</span> <span class='mi'>0</span>
|
||||
<span class='p'>};</span>
|
||||
<span class='p'>},</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='layout'>Layout</h3>
|
||||
|
||||
<p>The <code>Layout</code> layout mode method is where items are positioned. Most of your layout logic happens here. This method provides one argument <code>$elems</code> – a jQuery object with the item elements that need to be positioned.</p>
|
||||
|
||||
<p><code>$elems.each</code> is the principle loop, iterating over each item element and positioning it. Items are positioned with the <code>_pushPosition</code> method (see below). The layout modes properties are</p>
|
||||
|
||||
<p>For <em>fitRows</em>, items are placed with the <code>this.fitRows.x</code> and <code>this.fitRows.y</code> values. This position is determined by if the item can fit in the current row, or if a new row needs to be started.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>_fitRowsLayout</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>$elems</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='kd'>var</span> <span class='nx'>instance</span> <span class='o'>=</span> <span class='k'>this</span><span class='p'>,</span>
|
||||
<span class='nx'>containerWidth</span> <span class='o'>=</span> <span class='k'>this</span><span class='p'>.</span><span class='nx'>element</span><span class='p'>.</span><span class='nx'>width</span><span class='p'>(),</span>
|
||||
<span class='nx'>props</span> <span class='o'>=</span> <span class='k'>this</span><span class='p'>.</span><span class='nx'>fitRows</span><span class='p'>;</span>
|
||||
|
||||
<span class='nx'>$elems</span><span class='p'>.</span><span class='nx'>each</span><span class='p'>(</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span>
|
||||
<span class='kd'>var</span> <span class='nx'>$this</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='k'>this</span><span class='p'>),</span>
|
||||
<span class='nx'>atomW</span> <span class='o'>=</span> <span class='nx'>$this</span><span class='p'>.</span><span class='nx'>outerWidth</span><span class='p'>(</span><span class='kc'>true</span><span class='p'>),</span>
|
||||
<span class='nx'>atomH</span> <span class='o'>=</span> <span class='nx'>$this</span><span class='p'>.</span><span class='nx'>outerHeight</span><span class='p'>(</span><span class='kc'>true</span><span class='p'>);</span>
|
||||
|
||||
<span class='k'>if</span> <span class='p'>(</span> <span class='nx'>props</span><span class='p'>.</span><span class='nx'>x</span> <span class='o'>!==</span> <span class='mi'>0</span> <span class='o'>&&</span> <span class='nx'>atomW</span> <span class='o'>+</span> <span class='nx'>props</span><span class='p'>.</span><span class='nx'>x</span> <span class='o'>></span> <span class='nx'>containerWidth</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='c1'>// if this element cannot fit in the current row</span>
|
||||
<span class='nx'>props</span><span class='p'>.</span><span class='nx'>x</span> <span class='o'>=</span> <span class='mi'>0</span><span class='p'>;</span>
|
||||
<span class='nx'>props</span><span class='p'>.</span><span class='nx'>y</span> <span class='o'>=</span> <span class='nx'>props</span><span class='p'>.</span><span class='nx'>height</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='c1'>// position the atom</span>
|
||||
<span class='nx'>instance</span><span class='p'>.</span><span class='nx'>_pushPosition</span><span class='p'>(</span> <span class='nx'>$this</span><span class='p'>,</span> <span class='nx'>props</span><span class='p'>.</span><span class='nx'>x</span><span class='p'>,</span> <span class='nx'>props</span><span class='p'>.</span><span class='nx'>y</span> <span class='p'>);</span>
|
||||
|
||||
<span class='nx'>props</span><span class='p'>.</span><span class='nx'>height</span> <span class='o'>=</span> <span class='nb'>Math</span><span class='p'>.</span><span class='nx'>max</span><span class='p'>(</span> <span class='nx'>props</span><span class='p'>.</span><span class='nx'>y</span> <span class='o'>+</span> <span class='nx'>atomH</span><span class='p'>,</span> <span class='nx'>props</span><span class='p'>.</span><span class='nx'>height</span> <span class='p'>);</span>
|
||||
<span class='nx'>props</span><span class='p'>.</span><span class='nx'>x</span> <span class='o'>+=</span> <span class='nx'>atomW</span><span class='p'>;</span>
|
||||
|
||||
<span class='p'>});</span>
|
||||
<span class='p'>},</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='getcontainersize'>GetContainerSize</h3>
|
||||
|
||||
<p>After the script goes through positioning each item, it needs to resize the container. <code>GetContainerSize</code> returns the style for the size of the container.</p>
|
||||
|
||||
<p>In <em>fitRows</em>, the height property is returned as the value for height.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>_fitRowsGetContainerSize</span> <span class='o'>:</span> <span class='kd'>function</span> <span class='p'>()</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='p'>{</span> <span class='nx'>height</span> <span class='o'>:</span> <span class='k'>this</span><span class='p'>.</span><span class='nx'>fitRows</span><span class='p'>.</span><span class='nx'>height</span> <span class='p'>};</span>
|
||||
<span class='p'>},</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='resizechanged'>ResizeChanged</h3>
|
||||
|
||||
<p><code>ResizeChanged</code> is triggered whenever the browser window is resized. Before Isotope adjusts the layout, this method is triggered to determine if the layout has actually changed. The methods return a boolean.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>_fitRowsResizeChanged</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='kc'>true</span><span class='p'>;</span>
|
||||
<span class='p'>},</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='helper_methods'>Helper methods</h3>
|
||||
|
||||
<p>The <code>_pushPosition</code> method is used within a layout mode’s <code>Layout</code> method. It takes 3 arguments: the item element currently being positioned, the x position, and the y position.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>_pushPosition</span><span class='p'>(</span> <span class='nx'>$item</span><span class='p'>,</span> <span class='nx'>x</span><span class='p'>,</span> <span class='nx'>y</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p><code>_getSegments</code> is used within the layout mode’s <code>Reset</code> method. It performs several utilities:</p>
|
||||
|
||||
<ul>
|
||||
<li>Determines the <code>columnWidth</code> for the layout mode (<code>rowHeight</code> for horizontal layout modes). This is either passed in as an option (i.e. <code>masonry { columnWidth: 90 }</code>), or the width of the first item element. This property is then set for the layout mode, i.e. <code>this.masonry.columnWidth</code>.</li>
|
||||
|
||||
<li>Calculates the number of number of columns (or rows, if horizontal) given the size of the container. This property is then set for the layout mode, i.e. <code>this.masonry.cols</code>.</li>
|
||||
</ul>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>_getSegments</span><span class='p'>(</span> <span class='nx'>isHorizontal</span> <span class='p'>)</span>
|
||||
|
||||
<span class='c1'>// for example</span>
|
||||
<span class='nx'>_cellsByRowReset</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span>
|
||||
<span class='k'>this</span><span class='p'>.</span><span class='nx'>cellsByRow</span> <span class='o'>=</span> <span class='p'>{</span>
|
||||
<span class='nx'>index</span> <span class='o'>:</span> <span class='mi'>0</span>
|
||||
<span class='p'>};</span>
|
||||
<span class='c1'>// get this.cellsByRow.columnWidth</span>
|
||||
<span class='k'>this</span><span class='p'>.</span><span class='nx'>_getSegments</span><span class='p'>();</span>
|
||||
<span class='c1'>// get this.cellsByRow.rowHeight</span>
|
||||
<span class='k'>this</span><span class='p'>.</span><span class='nx'>_getSegments</span><span class='p'>(</span><span class='kc'>true</span><span class='p'>);</span>
|
||||
<span class='p'>},</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Similarly, <code>_checkIfSegmentsChanged</code> is used within <code>ResizeChanged</code>. It returns a boolean indicating whether or not the number of columns or rows has changed since the window has been resized.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>_checkIfSegmentsChanged</span><span class='p'>(</span> <span class='nx'>isHorizontal</span> <span class='p'>)</span>
|
||||
|
||||
<span class='c1'>// for example</span>
|
||||
<span class='nx'>_masonryResizeChanged</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='k'>this</span><span class='p'>.</span><span class='nx'>_checkIfSegmentsChanged</span><span class='p'>();</span>
|
||||
<span class='p'>},</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
268
sites/all/libraries/isotope-site/docs/filtering.html
Normal file
268
sites/all/libraries/isotope-site/docs/filtering.html
Normal file
@@ -0,0 +1,268 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Filtering · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Filtering</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#markup">Markup</a></li>
|
||||
|
||||
<li><a href="#jquery_script">jQuery script</a></li>
|
||||
|
||||
<li><a href="#creating_interactive_buttons">Creating interactive buttons</a></li>
|
||||
|
||||
<li><a href="#recommended_css">Recommended CSS</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Filtering</h1>
|
||||
|
||||
|
||||
<p>Isotope can hide and show item elements via the <a href='options.html#filter'><code>filter</code> option</a>. <code>filter</code> accepts a jQuery selector. Items that match that selector will be shown. Items that do not match will be hidden.</p>
|
||||
|
||||
<p><a href='../demos/filtering.html'><strong>See Demo: Filtering</strong></a></p>
|
||||
|
||||
<h2 id='markup'>Markup</h2>
|
||||
|
||||
<p>Each item element has several identifying classes. In this case, <code>transition</code>, <code>metal</code>, <code>lanthanoid</code>, <code>alkali</code>, etc.</p>
|
||||
<div class='highlight'><pre><code class='html'><span class='nt'><div</span> <span class='na'>id=</span><span class='s'>"container"</span><span class='nt'>></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element transition metal"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element post-transition metal"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element alkali metal"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element transition metal"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element lanthanoid metal inner-transition"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element halogen nonmetal"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element alkaline-earth metal"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
...
|
||||
<span class='nt'></div></span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='jquery_script'>jQuery script</h2>
|
||||
|
||||
<p>To show only <code>.metal</code> items, the jQuery script would be:</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span> <span class='nx'>filter</span><span class='o'>:</span> <span class='s1'>'.metal'</span> <span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>The <code>filter</code> option uses a <a href='http://api.jquery.com/category/selectors/'>jQuery selector</a> to show item elements that match a selector, and hide all others that do not. For example:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>.alkali, .alkaline-earth</code> will show <code>.alkali</code> AND <code> .alkaline-earth</code> item elements.</li>
|
||||
|
||||
<li><code>.metal.transition</code> will show item elements that have BOTH <code>.metal</code> and <code>.transition</code> classes.</li>
|
||||
|
||||
<li><code>.metal:not(.transition)</code> will show <code>.metal</code> item elements that are NOT <code>.transition</code>.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id='creating_interactive_buttons'>Creating interactive buttons</h2>
|
||||
|
||||
<p>Let’s use a basic list for our buttons</p>
|
||||
<div class='highlight'><pre><code class='html'><span class='nt'><ul</span> <span class='na'>id=</span><span class='s'>"filters"</span><span class='nt'>></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#"</span> <span class='na'>data-filter=</span><span class='s'>"*"</span><span class='nt'>></span>show all<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#"</span> <span class='na'>data-filter=</span><span class='s'>".metal"</span><span class='nt'>></span>metal<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#"</span> <span class='na'>data-filter=</span><span class='s'>".transition"</span><span class='nt'>></span>transition<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#"</span> <span class='na'>data-filter=</span><span class='s'>".alkali, .alkaline-earth"</span><span class='nt'>></span>alkali and alkaline-earth<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#"</span> <span class='na'>data-filter=</span><span class='s'>":not(.transition)"</span><span class='nt'>></span>not transition<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#"</span> <span class='na'>data-filter=</span><span class='s'>".metal:not(.transition)"</span><span class='nt'>></span>metal but not transition<span class='nt'></a></li></span>
|
||||
<span class='nt'></ul></span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Here we set the filter for each link with a <code>data-filter</code> attribute. In our jQuery script, whenever a link is clicked, we’ll use this attribute as the filter selector.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='c1'>// cache container</span>
|
||||
<span class='kd'>var</span> <span class='nx'>$container</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>);</span>
|
||||
<span class='c1'>// initialize isotope</span>
|
||||
<span class='nx'>$container</span><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='c1'>// options...</span>
|
||||
<span class='p'>});</span>
|
||||
|
||||
<span class='c1'>// filter items when filter link is clicked</span>
|
||||
<span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#filters a'</span><span class='p'>).</span><span class='nx'>click</span><span class='p'>(</span><span class='kd'>function</span><span class='p'>(){</span>
|
||||
<span class='kd'>var</span> <span class='nx'>selector</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='k'>this</span><span class='p'>).</span><span class='nx'>attr</span><span class='p'>(</span><span class='s1'>'data-filter'</span><span class='p'>);</span>
|
||||
<span class='nx'>$container</span><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>({</span> <span class='nx'>filter</span><span class='o'>:</span> <span class='nx'>selector</span> <span class='p'>});</span>
|
||||
<span class='k'>return</span> <span class='kc'>false</span><span class='p'>;</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='recommended_css'>Recommended CSS</h2>
|
||||
|
||||
<p>If you choose to use the filtering functionality, add the following CSS to your stylesheet:</p>
|
||||
<div class='highlight'><pre><code class='css'><span class='c'>/**** Isotope filtering ****/</span>
|
||||
|
||||
<span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='k'>z-index</span><span class='o'>:</span> <span class='m'>2</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='nc'>.isotope-hidden.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='k'>pointer</span><span class='o'>-</span><span class='n'>events</span><span class='o'>:</span> <span class='k'>none</span><span class='p'>;</span>
|
||||
<span class='k'>z-index</span><span class='o'>:</span> <span class='m'>1</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>These styles ensure that hidden items will not interfere with interactions.</p>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,245 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Hash history with jQuery BBQ · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Hash history with jQuery BBQ</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#markup">Markup</a></li>
|
||||
|
||||
<li><a href="#jquery_script">jQuery script</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Hash history with jQuery BBQ</h1>
|
||||
|
||||
|
||||
<p>As cool as Isotope is, the only thing that could make it even cooler would be adding bookmark-able URL hashes. Ben Alman’s <a href='http://benalman.com/projects/jquery-bbq-plugin/'>jQuery BBQ</a> allows us to do just that.</p>
|
||||
|
||||
<blockquote>
|
||||
<p>jQuery BBQ leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history.</p>
|
||||
</blockquote>
|
||||
|
||||
<p><a href='../demos/hash-history.html'><strong>See Demo: Hash history</strong></a></p>
|
||||
|
||||
<p>BBQ is a marvelous plugin that provides for a lot more functionality. The <a href='../demos/hash-history.html'>hash history demo</a> uses multiple options (<code>sortBy</code>, <code>sortAscending</code>, and <code>layoutMode</code> in addition to <code>filter</code>), the ability to use back-button history, and properly highlights selected links.</p>
|
||||
|
||||
<p>Given BBQ’s tremendous capabilities, the code can grow to be a bit complex. Be sure to read through <a href='http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html'>BBQ’s docs</a> and take look at <a href='http://benalman.com/code/projects/jquery-bbq/examples/'>its examples</a> before you dive in and code up your own solution.</p>
|
||||
|
||||
<h2 id='markup'>Markup</h2>
|
||||
|
||||
<p>Instead of setting the option values and keys with <code>data</code> attributes, we can add the option in the <code>href</code> for each link.</p>
|
||||
<div class='highlight'><pre><code class='html'><span class='nt'><ul</span> <span class='na'>class=</span><span class='s'>"option-set"</span><span class='nt'>></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#filter=*"</span> <span class='na'>class=</span><span class='s'>"selected"</span><span class='nt'>></span>show all<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#filter=.metal"</span><span class='nt'>></span>metal<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#filter=.transition"</span><span class='nt'>></span>transition<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#filter=.alkali%2C+.alkaline-earth"</span><span class='nt'>></span>alkali and alkaline-earth<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#filter=%3Anot(.transition)"</span><span class='nt'>></span>not transition<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#filter=.metal%3Anot(.transition)"</span><span class='nt'>></span>metal but not transition<span class='nt'></a></li></span>
|
||||
<span class='nt'></ul></span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>The <code>href</code> value is a serialized string, suitable for a URL. These values can be created with <a href='http://api.jquery.com/jQuery.param/'>jQuery.param()</a>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>.</span><span class='nx'>param</span><span class='p'>({</span> <span class='nx'>filter</span><span class='o'>:</span> <span class='s1'>'.metal'</span> <span class='p'>})</span>
|
||||
<span class='c1'>// >> "filter=.metal"</span>
|
||||
<span class='nx'>$</span><span class='p'>.</span><span class='nx'>param</span><span class='p'>({</span> <span class='nx'>filter</span><span class='o'>:</span> <span class='s1'>'.alkali, alkaline-earth'</span> <span class='p'>})</span>
|
||||
<span class='c1'>// >> "filter=.alkali%2C+alkaline-earth"</span>
|
||||
<span class='nx'>$</span><span class='p'>.</span><span class='nx'>param</span><span class='p'>({</span> <span class='nx'>filter</span><span class='o'>:</span> <span class='s1'>':not(.transition)'</span> <span class='p'>})</span>
|
||||
<span class='c1'>// >> "#filter=%3Anot(.transition)"</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='jquery_script'>jQuery script</h2>
|
||||
|
||||
<p>These serialized <code>href</code> values can be converted into their proper jQuery object form when clicked using <a href='http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html#jQuery.deparam'>jQuery.deparam()</a> from jQuery BBQ.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'.option-set a'</span><span class='p'>).</span><span class='nx'>click</span><span class='p'>(</span><span class='kd'>function</span><span class='p'>(){</span>
|
||||
<span class='c1'>// get href attr, remove leading #</span>
|
||||
<span class='kd'>var</span> <span class='nx'>href</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='k'>this</span><span class='p'>).</span><span class='nx'>attr</span><span class='p'>(</span><span class='s1'>'href'</span><span class='p'>).</span><span class='nx'>replace</span><span class='p'>(</span> <span class='sr'>/^#/</span><span class='p'>,</span> <span class='s1'>''</span> <span class='p'>),</span>
|
||||
<span class='c1'>// convert href into object</span>
|
||||
<span class='c1'>// i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' }</span>
|
||||
<span class='nx'>option</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>.</span><span class='nx'>deparam</span><span class='p'>(</span> <span class='nx'>href</span><span class='p'>,</span> <span class='kc'>true</span> <span class='p'>);</span>
|
||||
<span class='c1'>// set hash, triggers hashchange on window</span>
|
||||
<span class='nx'>$</span><span class='p'>.</span><span class='nx'>bbq</span><span class='p'>.</span><span class='nx'>pushState</span><span class='p'>(</span> <span class='nx'>option</span> <span class='p'>);</span>
|
||||
<span class='k'>return</span> <span class='kc'>false</span><span class='p'>;</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Calling <a href='http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html#jQuery.bbq.pushState'>$.bbq.pushState()</a> will trigger the <code>hashchange</code> event. At that point, we can parse the hash from the URL and use it to trigger the proper change in the Isotope instance.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='nb'>window</span><span class='p'>).</span><span class='nx'>bind</span><span class='p'>(</span> <span class='s1'>'hashchange'</span><span class='p'>,</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>event</span> <span class='p'>){</span>
|
||||
<span class='c1'>// get options object from hash</span>
|
||||
<span class='kd'>var</span> <span class='nx'>hashOptions</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>.</span><span class='nx'>deparam</span><span class='p'>.</span><span class='nx'>fragment</span><span class='p'>();</span>
|
||||
<span class='c1'>// apply options from hash</span>
|
||||
<span class='nx'>$container</span><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='nx'>hashOptions</span> <span class='p'>);</span>
|
||||
<span class='p'>})</span>
|
||||
<span class='c1'>// trigger hashchange to capture any hash data on init</span>
|
||||
<span class='p'>.</span><span class='nx'>trigger</span><span class='p'>(</span><span class='s1'>'hashchange'</span><span class='p'>);</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Now any filter buttons that are clicked will update the URL hash, so these options can be bookmarked.</p>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
390
sites/all/libraries/isotope-site/docs/help.html
Normal file
390
sites/all/libraries/isotope-site/docs/help.html
Normal file
@@ -0,0 +1,390 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Help · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Help</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#reporting_bugs_and_issues">Reporting bugs and issues</a></li>
|
||||
|
||||
<li><a href="#support_license">Support license</a></li>
|
||||
|
||||
<li><a href="#additional_resources">Additional resources</a></li>
|
||||
|
||||
<li><a href="#unloaded_media">Unloaded media</a></li>
|
||||
|
||||
<li><a href="#images">Images</a></li>
|
||||
|
||||
<li><a href="#fontface_fonts">@font-face fonts</a></li>
|
||||
|
||||
<li><a href="#accessing_the_instance">Accessing the instance</a></li>
|
||||
|
||||
<li><a href="#css_transforms_in_opera">CSS transforms in Opera</a></li>
|
||||
|
||||
<li><a href="#infinite_scroll_with_filtering_or_sorting">Infinite Scroll with filtering or sorting</a></li>
|
||||
|
||||
<li><a href="#flash">Flash</a></li>
|
||||
|
||||
<li><a href="#poor_type_rendering_in_webkit">Poor type rendering in WebKit</a></li>
|
||||
|
||||
<li><a href="#righttoleft_layouts">Right-to-left layouts</a></li>
|
||||
|
||||
<li><a href="#unclickable-filtered">Preventing clicks on filtered items</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Help</h1>
|
||||
|
||||
|
||||
<h2 id='reporting_bugs_and_issues'>Reporting bugs and issues</h2>
|
||||
|
||||
<p><a href='http://github.com/desandro/isotope/issues'>Report bugs and issues on GitHub</a>.</p>
|
||||
|
||||
<h3 id='issues-guidelines'>Guidelines</h3>
|
||||
|
||||
<ul>
|
||||
<li>Look over open and closed issues before submitting yours.</li>
|
||||
|
||||
<li>Add a link to a live site with the bug. If the project is confidential, try re-creating it in <a href='http://jsfiddle.net'>jsFiddle</a>.</li>
|
||||
</ul>
|
||||
|
||||
<p>The issues tracker is for bugs and issues — when Isotope doesn’t work as expected. It is not for implementation issues — when you are having trouble setting up Isotope. Consider a <a href='http://metafizzy.co/#support-license'>Support License</a> for implementation issues. If you’re not sure, go ahead and submit an issue.</p>
|
||||
|
||||
<h2 id='support_license'>Support license</h2>
|
||||
|
||||
<p>If you’ve tried everything and would really like to get my eyes looking at your code, you can purchase a <a href='http://metafizzy.co/#support-license'>Support License from Metafizzy</a>.</p>
|
||||
|
||||
<p>Support License is included with Isotope Commercial License.</p>
|
||||
|
||||
<h2 id='additional_resources'>Additional resources</h2>
|
||||
|
||||
<ul>
|
||||
<li>The <a href='http://metafizzy.co/blog/'>Metafizzy blog</a> has posts that cover specialized use cases</li>
|
||||
|
||||
<li><a href='http://zootool.com/user/desandro/tag:isotope'>Sites using Isotope on Zootool</a>, has screenshots</li>
|
||||
|
||||
<li><a href='http://www.delicious.com/desandro/using:isotope'>Sites using Isotope on Delicious</a></li>
|
||||
|
||||
<li><a href='http://www.delicious.com/desandro/re:isotope'>Miscelleanous Isotope content</a></li>
|
||||
|
||||
<li><a href='http://www.delicious.com/desandro/re:isotope+stackoverflow'>Stack Overflow questions on Isotope</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id='unloaded_media'>Unloaded media</h2>
|
||||
|
||||
<p>Most layout modes (i.e masonry, fitRows) need to measure the size of each item to appropriately account for its space in the layout. Unloaded media files like images and @font-face fonts can throw off layout and cause item elements to overlap one another. Ideally, Isotope layouts should be initialized after all inner content has loaded.</p>
|
||||
|
||||
<h2 id='images'>Images</h2>
|
||||
|
||||
<h3 id='inline_dimensions'>Inline dimensions</h3>
|
||||
|
||||
<p>For images, the best method is to specify the width and height of images inline.</p>
|
||||
<div class='highlight'><pre><code class='html'><span class='nt'><img</span> <span class='na'>src=</span><span class='s'>"img-file.jpg"</span> <span class='na'>width=</span><span class='s'>"280"</span> <span class='na'>height=</span><span class='s'>"160"</span> <span class='nt'>/></span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>If you’re using a PHP-based CMS, you can use the <a href='http://php.net/manual/en/function.getimagesize.php'>getimagesize</a> function.</p>
|
||||
|
||||
<h3 id='imagesloaded_plugin'>imagesLoaded plugin</h3>
|
||||
|
||||
<p>The next best solution is to use the <a href='https://github.com/desandro/imagesloaded'>imagesLoaded plugin</a> included with Isotope. It’s a small plugin that finds all the images in a context, and fires a callback function once all the images have loaded.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='kd'>var</span> <span class='nx'>$container</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>);</span>
|
||||
|
||||
<span class='nx'>$container</span><span class='p'>.</span><span class='nx'>imagesLoaded</span><span class='p'>(</span> <span class='kd'>function</span><span class='p'>(){</span>
|
||||
<span class='nx'>$container</span><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='c1'>// options...</span>
|
||||
<span class='p'>});</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='id1'><code>$(window).load()</code></h3>
|
||||
|
||||
<p>Another solution is to initialize Isotope inside <code>$(window).load()</code> instead of <code>$(document).ready()</code>. This will trigger Isotope after all the media on the page has loaded.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='nb'>window</span><span class='p'>).</span><span class='nx'>load</span><span class='p'>(</span><span class='kd'>function</span><span class='p'>(){</span>
|
||||
<span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='c1'>// options...</span>
|
||||
<span class='p'>});</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='fontface_fonts'>@font-face fonts</h2>
|
||||
|
||||
<p>Both Typekit and Google WebFont Loader provide font events to control scripts based on how fonts are loaded.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href='http://blog.typekit.com/2010/10/18/more-control-with-typekits-font-events/'>Typekit font events</a></li>
|
||||
|
||||
<li><a href='http://code.google.com/apis/webfonts/docs/webfont_loader.html#Events'>Google WebFont Loader: Events</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id='accessing_the_instance'>Accessing the instance</h2>
|
||||
|
||||
<p><a href='http://docs.jquery.com/UI_Developer_Guide#Internal_functions_.26_scopes_explained'>Similar to jQuery UI</a>, Isotope stores a instance containing properties, settings and methods with jQuery.data. You can access the instance with the <code>'isotope'</code> namespace.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='kd'>var</span> <span class='nx'>$container</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>);</span>
|
||||
|
||||
<span class='c1'>// initialize Isotope instance</span>
|
||||
<span class='nx'>$container</span><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='c1'>// options...</span>
|
||||
<span class='p'>});</span>
|
||||
|
||||
<span class='c1'>// get Isotope instance</span>
|
||||
<span class='kd'>var</span> <span class='nx'>isotopeInstance</span> <span class='o'>=</span> <span class='nx'>$container</span><span class='p'>.</span><span class='nx'>data</span><span class='p'>(</span><span class='s1'>'isotope'</span><span class='p'>);</span>
|
||||
<span class='nx'>isotopeInstance</span><span class='p'>.</span><span class='nx'>options</span><span class='p'>;</span> <span class='c1'>// options</span>
|
||||
<span class='nx'>isotopeInstance</span><span class='p'>.</span><span class='nx'>$filteredAtoms</span><span class='p'>;</span> <span class='c1'>// jQuery object of filtered & sorted item elements</span>
|
||||
<span class='nx'>isotopeInstance</span><span class='p'>.</span><span class='nx'>masonry</span><span class='p'>.</span><span class='nx'>columnWidth</span><span class='p'>;</span> <span class='c1'>// Layout mode specific properties</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='css_transforms_in_opera'>CSS transforms in Opera</h2>
|
||||
|
||||
<p>Currently, <a href='http://dropshado.ws/post/1260101028/opera-transform-issues'>using CSS transforms in Opera distorts text rendering</a>. To avoid this issue, I recommend disabling Isotope to use transforms.</p>
|
||||
|
||||
<p>Isotope’s default options are already set to not use CSS transforms in Opera.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='c1'>// Isotope default options</span>
|
||||
<span class='nx'>hiddenStyle</span> <span class='o'>:</span> <span class='nx'>Modernizr</span><span class='p'>.</span><span class='nx'>csstransforms</span> <span class='o'>&&</span> <span class='o'>!</span><span class='nx'>$</span><span class='p'>.</span><span class='nx'>browser</span><span class='p'>.</span><span class='nx'>opera</span> <span class='o'>?</span>
|
||||
<span class='p'>{</span> <span class='nx'>opacity</span> <span class='o'>:</span> <span class='mi'>0</span><span class='p'>,</span> <span class='nx'>scale</span> <span class='o'>:</span> <span class='mf'>0.001</span> <span class='p'>}</span> <span class='o'>:</span> <span class='c1'>// browsers support CSS transforms, not Opera</span>
|
||||
<span class='p'>{</span> <span class='nx'>opacity</span> <span class='o'>:</span> <span class='mi'>0</span> <span class='p'>},</span> <span class='c1'>// other browsers, including Opera</span>
|
||||
<span class='nx'>visibleStyle</span> <span class='o'>:</span> <span class='nx'>Modernizr</span><span class='p'>.</span><span class='nx'>csstransforms</span> <span class='o'>&&</span> <span class='o'>!</span><span class='nx'>$</span><span class='p'>.</span><span class='nx'>browser</span><span class='p'>.</span><span class='nx'>opera</span> <span class='o'>?</span>
|
||||
<span class='p'>{</span> <span class='nx'>opacity</span> <span class='o'>:</span> <span class='mi'>1</span><span class='p'>,</span> <span class='nx'>scale</span> <span class='o'>:</span> <span class='mi'>1</span> <span class='p'>}</span> <span class='o'>:</span> <span class='c1'>// browsers support CSS transforms, not Opera</span>
|
||||
<span class='p'>{</span> <span class='nx'>opacity</span> <span class='o'>:</span> <span class='mi'>1</span> <span class='p'>},</span> <span class='c1'>// other browsers, including Opera</span>
|
||||
<span class='nx'>animationEngine</span> <span class='o'>:</span> <span class='nx'>$</span><span class='p'>.</span><span class='nx'>browser</span><span class='p'>.</span><span class='nx'>opera</span> <span class='o'>?</span> <span class='s1'>'jquery'</span> <span class='o'>:</span> <span class='s1'>'best-available'</span><span class='p'>,</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Also note that the <a href='animating.html#css_transitions'>recommended transition CSS</a> is missing declarations for Opera.</p>
|
||||
|
||||
<h2 id='infinite_scroll_with_filtering_or_sorting'>Infinite Scroll with filtering or sorting</h2>
|
||||
|
||||
<p>I recommend against using Infinite Scroll with filtering or sorting. This combination produces a unnecessarily complex user interaction that will frustrate your users. New content gets added, but part of it might be hidden. There is no way for the user to tell what gets hidden or re-arranged when Infinite Scroll adds more content. Exercise <a href='introduction.html#moderation'>moderation</a> with your Isotope implementation.</p>
|
||||
|
||||
<p>If you do plan on implementing Infinite Scroll with filtering or sorting (which is a <em>bad idea</em>), use the <code>insert</code> method instead of <code>appended</code>.</p>
|
||||
|
||||
<h2 id='flash'>Flash</h2>
|
||||
|
||||
<p><a href='http://dropshado.ws/post/4085720152/css-transforms-breaking-flash'>Using CSS transforms with Flash content is a bit buggy in Safari and Firefox</a>. This is problematic when using Isotope on item elements that contain Flash content like YouTube or Vimeo videos, Flash ads, or Flash audio players.</p>
|
||||
|
||||
<p>The best way to resolve this issue is to disable CSS transforms by setting the <a href='options.html#transformsenabled'><code>transformsEnabled</code> option</a> to <code><span class='kc'>false</span></code>.</p>
|
||||
|
||||
<h2 id='poor_type_rendering_in_webkit'>Poor type rendering in WebKit</h2>
|
||||
|
||||
<p>Type rendering may appear poor in WebKit browsers like Chrome and Safari. This is because of Isotope’s activation of hardware acceleration. The solution is to add add a matching background to the item elements. See more: <a href='http://dropshado.ws/post/6142339613/resolving-anti-aliasing-on-webkit-hardware-accelerated'>dropshado.ws - Resolving anti-aliasing on WebKit hardware-accelerated elements</a>.</p>
|
||||
|
||||
<h2 id='righttoleft_layouts'>Right-to-left layouts</h2>
|
||||
|
||||
<p>Isotope can be modified to support right-to-left layouts for languages like Hebrew and Arabic.</p>
|
||||
|
||||
<p><a href='../tests/right-to-left.html'><strong>See test: Right to left</strong></a></p>
|
||||
|
||||
<p>You’ll need to make the following changes:</p>
|
||||
|
||||
<ul>
|
||||
<li>Modify Isotope’s <code>_positionAbs</code> method</li>
|
||||
|
||||
<li>Set <code>transformsEnabled: false</code> in the Isotope options</li>
|
||||
|
||||
<li>Add CSS transition property styles for right/top.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id='javascript_for_righttoleft_support'>JavaScript for right-to-left support</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='c1'>// modify Isotope's absolute position method</span>
|
||||
<span class='nx'>$</span><span class='p'>.</span><span class='nx'>Isotope</span><span class='p'>.</span><span class='nx'>prototype</span><span class='p'>.</span><span class='nx'>_positionAbs</span> <span class='o'>=</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>x</span><span class='p'>,</span> <span class='nx'>y</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='p'>{</span> <span class='nx'>right</span><span class='o'>:</span> <span class='nx'>x</span><span class='p'>,</span> <span class='nx'>top</span><span class='o'>:</span> <span class='nx'>y</span> <span class='p'>};</span>
|
||||
<span class='p'>};</span>
|
||||
|
||||
<span class='c1'>// initialize Isotope</span>
|
||||
<span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>transformsEnabled</span><span class='o'>:</span> <span class='kc'>false</span>
|
||||
<span class='c1'>// other options...</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='css_for_righttoleft_support'>CSS for right-to-left support</h3>
|
||||
<div class='highlight'><pre><code class='css'><span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>right</span><span class='o'>,</span> <span class='k'>top</span><span class='o'>,</span> <span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>right</span><span class='o'>,</span> <span class='k'>top</span><span class='o'>,</span> <span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='err'>o</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>right</span><span class='o'>,</span> <span class='k'>top</span><span class='o'>,</span> <span class='o'>-</span><span class='err'>o</span><span class='o'>-</span><span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>right</span><span class='o'>,</span> <span class='k'>top</span><span class='o'>,</span> <span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='unclickable-filtered'>Preventing clicks on filtered items</h2>
|
||||
|
||||
<p>The <a href='filtering.html#recommended_css'>recommended CSS for filtering</a> includes <code>pointer-events: none</code> for <code>.isotope-hidden</code>. Unfortunately, Opera and Internet Explorer still let click events propagate with this style in place. But you can still dismiss click events in your click handler by checking to see if the element or element’s parent is a filtered item.</p>
|
||||
|
||||
<p><a href='../tests/unclickable-filtered.html'>See test: Unclickable filtered</a></p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'.item a'</span><span class='p'>).</span><span class='nx'>click</span><span class='p'>(</span><span class='kd'>function</span><span class='p'>(){</span>
|
||||
<span class='kd'>var</span> <span class='nx'>$this</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='k'>this</span><span class='p'>);</span>
|
||||
<span class='c1'>// back out if hidden item</span>
|
||||
<span class='k'>if</span> <span class='p'>(</span> <span class='nx'>$this</span><span class='p'>.</span><span class='nx'>parents</span><span class='p'>(</span><span class='s1'>'.isotope-item'</span><span class='p'>).</span><span class='nx'>hasClass</span><span class='p'>(</span><span class='s1'>'isotope-hidden'</span><span class='p'>)</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='c1'>// otherwise, continue to do stuff...</span>
|
||||
<span class='nx'>console</span><span class='p'>.</span><span class='nx'>log</span><span class='p'>(</span><span class='s1'>'item was clicked'</span><span class='p'>);</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
325
sites/all/libraries/isotope-site/docs/introduction.html
Normal file
325
sites/all/libraries/isotope-site/docs/introduction.html
Normal file
@@ -0,0 +1,325 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Introduction · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Introduction</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#features">Features</a></li>
|
||||
|
||||
<li><a href="#licensing">Licensing</a></li>
|
||||
|
||||
<li><a href="#getting_started">Getting started</a></li>
|
||||
|
||||
<li><a href="#code_repository">Code repository</a></li>
|
||||
|
||||
<li><a href="#moderation">A word about moderation</a></li>
|
||||
|
||||
<li><a href="#acknowledgments">Acknowledgments</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Introduction</h1>
|
||||
|
||||
|
||||
<p class='tagline'>Isotope: An exquisite jQuery plugin for magical layouts</p>
|
||||
<h2 id='features'>Features</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href='layout-modes.html'><strong>Layout modes</strong></a>: Intelligent, dynamic layouts that can’t be achieved with CSS alone.</li>
|
||||
|
||||
<li><a href='filtering.html'><strong>Filtering</strong></a>: Hide and reveal item elements easily with jQuery selectors.</li>
|
||||
|
||||
<li><a href='sorting.html'><strong>Sorting</strong></a>: Re-order item elements with sorting. Sorting data can be extracted from just about anything.</li>
|
||||
|
||||
<li><strong>Interoperability</strong>: features can be utilized together for a cohesive experience.</li>
|
||||
|
||||
<li><strong>Progressive enhancement</strong>: Isotope’s <a href='animating.html'>animation engine</a> takes advantage of the best browser features when available — CSS transitions and transforms, GPU acceleration — but will also fall back to JavaScript animation for lesser browsers.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id='licensing'>Licensing</h2>
|
||||
<p id='commercial'>
|
||||
<strong>Commercial use of Isotope requires purchase of one-time license fee per developer seat.</strong> Commercial use includes any application that makes you money — portfolio sites, premium templates, etc. Commercial licenses may be purchased at <a href='http://metafizzy.co/#isotope-license'>metafizzy.co</a>.
|
||||
</p>
|
||||
<p>Use in non-commercial and personal applications is free.</p>
|
||||
|
||||
<h2 id='getting_started'>Getting started</h2>
|
||||
|
||||
<p>Isotope requires jQuery 1.4.3 and greater.</p>
|
||||
|
||||
<h3 id='markup'>Markup</h3>
|
||||
|
||||
<p>Isotope works on a container element with a group of similar child items.</p>
|
||||
<div class='highlight'><pre><code class='html'><span class='nt'><div</span> <span class='na'>id=</span><span class='s'>"container"</span><span class='nt'>></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"item"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"item"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"item"</span><span class='nt'>></span>...<span class='nt'></div></span>
|
||||
...
|
||||
<span class='nt'></div></span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='script'>Script</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='c1'>// options</span>
|
||||
<span class='nx'>itemSelector</span> <span class='o'>:</span> <span class='s1'>'.item'</span><span class='p'>,</span>
|
||||
<span class='nx'>layoutMode</span> <span class='o'>:</span> <span class='s1'>'fitRows'</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p><a href='../demos/basic.html'><strong>See Demo: Basic</strong></a></p>
|
||||
|
||||
<p>There are a number of <a href='options.html'>options</a> you can specify. Within the options is where you can <a href='layout-modes.html'>set the layout mode</a>, <a href='filtering.html'>filter items</a>, and <a href='sorting.html'>sort items</a>.</p>
|
||||
|
||||
<p>Additionally you can specify a callback after the options object. This function will be triggered after the animation has completed.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span> <span class='nx'>filter</span><span class='o'>:</span> <span class='s1'>'.my-selector'</span> <span class='p'>},</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>$items</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='kd'>var</span> <span class='nx'>id</span> <span class='o'>=</span> <span class='k'>this</span><span class='p'>.</span><span class='nx'>attr</span><span class='p'>(</span><span class='s1'>'id'</span><span class='p'>),</span>
|
||||
<span class='nx'>len</span> <span class='o'>=</span> <span class='nx'>$items</span><span class='p'>.</span><span class='nx'>length</span><span class='p'>;</span>
|
||||
<span class='nx'>console</span><span class='p'>.</span><span class='nx'>log</span><span class='p'>(</span> <span class='s1'>'Isotope has filtered for '</span> <span class='o'>+</span> <span class='nx'>len</span> <span class='o'>+</span> <span class='s1'>' items in #'</span> <span class='o'>+</span> <span class='nx'>id</span> <span class='p'>);</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Within this callback <code><span class='k'>this</span></code> refers to the container, and <code>$items</code> refers to the item elements. Both of these are jQuery objects and do <em>not</em> need to be put in jQuery wrappers.</p>
|
||||
|
||||
<h3 id='css'>CSS</h3>
|
||||
|
||||
<p>Add these styles to your CSS for <a href='filtering.html'>filtering</a>, <a href='animating.html'>animation</a> with CSS transitions, and <a href='adding-items.html'>adding items</a>.</p>
|
||||
<div class='highlight'><pre><code class='css'><span class='c'>/**** Isotope Filtering ****/</span>
|
||||
|
||||
<span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='k'>z-index</span><span class='o'>:</span> <span class='m'>2</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='nc'>.isotope-hidden.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='k'>pointer</span><span class='o'>-</span><span class='n'>events</span><span class='o'>:</span> <span class='k'>none</span><span class='p'>;</span>
|
||||
<span class='k'>z-index</span><span class='o'>:</span> <span class='m'>1</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='c'>/**** Isotope CSS3 transitions ****/</span>
|
||||
|
||||
<span class='nc'>.isotope</span><span class='o'>,</span>
|
||||
<span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0.8s</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0.8s</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0.8s</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='nc'>.isotope</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>height</span><span class='o'>,</span> <span class='k'>width</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>height</span><span class='o'>,</span> <span class='k'>width</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>height</span><span class='o'>,</span> <span class='k'>width</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='n'>transform</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
|
||||
<span class='c'>/**** disabling Isotope CSS3 transitions ****/</span>
|
||||
|
||||
<span class='nc'>.isotope.no-transition</span><span class='o'>,</span>
|
||||
<span class='nc'>.isotope.no-transition</span> <span class='nc'>.isotope-item</span><span class='o'>,</span>
|
||||
<span class='nc'>.isotope</span> <span class='nc'>.isotope-item.no-transition</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0s</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0s</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>duration</span><span class='o'>:</span> <span class='m'>0s</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='code_repository'>Code repository</h2>
|
||||
|
||||
<p>This project lives on GitHub at <a href='http://github.com/desandro/isotope'>github.com/desandro/isotope</a>. There you can grab the latest code and follow development.</p>
|
||||
|
||||
<h2 id='moderation'>A word about moderation</h2>
|
||||
|
||||
<p>Isotope enables a wealth of functionality. But just because you can take advantage of its numerous features together, doesn’t mean you necessarily should. For each each feature you implement with Isotope, consider the benefit gained by users, at the cost of another level of complexity to your interface.</p>
|
||||
|
||||
<h2 id='acknowledgments'>Acknowledgments</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href='http://benalman.com/'><strong>“Cowboy” Ben Alman</strong></a> for <a href='http://benalman.com/projects/jquery-bbq-plugin/'>jQuery BBQ</a> (included with docs)</li>
|
||||
|
||||
<li><a href='http://twitter.com/Louis_Remi'><strong>Louis-Rémi Babé</strong></a> for <a href='https://github.com/louisremi/jquery-smartresize'>jQuery smartresize</a> (used within Isotope) and for <a href='https://github.com/louisremi/jquery.transform.js'>jQuery transform</a> which clued me in to using jQuery 1.4.3’s CSS hooks</li>
|
||||
|
||||
<li><a href='http://razorjack.net/'><strong>Jacek Galanciak</strong></a> for <a href='http://razorjack.net/quicksand/'>jQuery Quicksand</a>, an early kernel of inspiration</li>
|
||||
|
||||
<li><a href='http://twitter.com/#!/ralphholzmann'><strong>Ralph Holzmann</strong></a> for re-writing the <a href='http://docs.jquery.com/Plugins/Authoring'>jQuery Plugins/Authoring tutorial</a> and opened my eyes to <a href='http://docs.jquery.com/Plugins/Authoring#Plugin_Methods'>Plugin Methods</a> pattern</li>
|
||||
|
||||
<li><a href='http://www.erichynds.com/'><strong>Eric Hynds</strong></a> for his article <a href='http://www.erichynds.com/jquery/using-jquery-ui-widget-factory-bridge/'>Using $.widget.bridge Outside of the Widget Factory</a> which provided the architecture for Isotope</li>
|
||||
|
||||
<li><a href='http://paul-irish.com'><strong>Paul Irish</strong></a> for <a href='http://infinite-scroll.com'>Infinite Scroll</a> (included with docs), the <a href='http://gist.github.com/268257'>imagesLoaded plugin</a> (included with Isotope), and <a href='http://paulirish.com/demo/resize'>Debounced resize() plugin</a> (provided base for smartresize)</li>
|
||||
|
||||
<li>The <a href='http://jqueryui.com/about'><strong>jQuery UI Team</strong></a> for <a href='https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L113-155'>$.widget.bridge</a> (partially used within Isotope)</li>
|
||||
|
||||
<li>The Modernizr team for <a href='http://www.modernizr.com/'>Modernizr</a> (partially used within Isotope)</li>
|
||||
|
||||
<li><a href='http://perfectionkills.com'><strong>Juriy Zaytsev aka “kangax”</strong></a> for <a href='http://perfectionkills.com/feature-testing-css-properties/'>getStyleProperty</a> (used within Isotope)</li>
|
||||
</ul>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
336
sites/all/libraries/isotope-site/docs/layout-modes.html
Normal file
336
sites/all/libraries/isotope-site/docs/layout-modes.html
Normal file
@@ -0,0 +1,336 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Layout modes · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs option-def">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Layout modes</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#cellsbycolumn">cellsByColumn</a></li>
|
||||
|
||||
<li><a href="#cellsbyrow">cellsByRow</a></li>
|
||||
|
||||
<li><a href="#fitcolumns">fitColumns</a></li>
|
||||
|
||||
<li><a href="#fitrows">fitRows</a></li>
|
||||
|
||||
<li><a href="#masonry">masonry</a></li>
|
||||
|
||||
<li><a href="#masonryhorizontal">masonryHorizontal</a></li>
|
||||
|
||||
<li><a href="#straightacross">straightAcross</a></li>
|
||||
|
||||
<li><a href="#straightdown">straightDown</a></li>
|
||||
|
||||
<li><a href="#horizontal_layouts">Horizontal layouts</a></li>
|
||||
|
||||
<li><a href="#modified_layout_modes">Modified layout modes</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Layout modes</h1>
|
||||
|
||||
|
||||
<p>Isotope has a versatile layout engine that can accommodate multiple layout modes. You can set and change the layout mode via the <code>layoutMode</code> option.</p>
|
||||
|
||||
<p><a href='../demos/layout-modes.html'><strong>See Demo: Layout modes</strong></a></p>
|
||||
|
||||
<h3 id='example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span> <span class='nx'>layoutMode</span> <span class='o'>:</span> <span class='s1'>'fitRows'</span> <span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Several layout modes are built into Isotope.</p>
|
||||
|
||||
<h2 id='cellsbycolumn'>cellsByColumn</h2>
|
||||
|
||||
<p>A grid layout where items are centered inside each cell. The grid is defined by two options, <code>columnWidth</code> and <code>rowHeight</code>. The horizontal equivalent of cellsByRow.</p>
|
||||
|
||||
<h3 id='cellsByColumn-options'>Options</h3>
|
||||
<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>
|
||||
<h3 id='cellsByColumn-example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>layoutMode</span> <span class='o'>:</span> <span class='s1'>'cellsByColumn'</span><span class='p'>,</span>
|
||||
<span class='nx'>cellsByRow</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>columnWidth</span> <span class='o'>:</span> <span class='mi'>240</span><span class='p'>,</span>
|
||||
<span class='nx'>rowHeight</span> <span class='o'>:</span> <span class='mi'>360</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='cellsbyrow'>cellsByRow</h2>
|
||||
|
||||
<p>A grid layout where items are centered inside each cell. The grid is defined by two options, <code>columnWidth</code> and <code>rowHeight</code>.</p>
|
||||
|
||||
<h3 id='cellsByRow-options'>Options</h3>
|
||||
<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>
|
||||
<h3 id='cellsByRow-example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>layoutMode</span> <span class='o'>:</span> <span class='s1'>'cellsByRow'</span><span class='p'>,</span>
|
||||
<span class='nx'>cellsByRow</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>columnWidth</span> <span class='o'>:</span> <span class='mi'>240</span><span class='p'>,</span>
|
||||
<span class='nx'>rowHeight</span> <span class='o'>:</span> <span class='mi'>360</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='fitcolumns'>fitColumns</h2>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<h2 id='fitrows'>fitRows</h2>
|
||||
|
||||
<p>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 <code>float: left</code>.</p>
|
||||
|
||||
<h2 id='masonry'>masonry</h2>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<h3 id='masonry-options'>Options</h3>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>columnWidth</code></dt>
|
||||
<dd class='option-type'>Integer</dd>
|
||||
</dl>
|
||||
<p>The width of one column in the grid. If no value is set for <code>columnWidth</code>, default is the width of the first item element.</p>
|
||||
|
||||
<h3 id='masonry-example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>masonry</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>columnWidth</span> <span class='o'>:</span> <span class='mi'>240</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='masonryhorizontal'>masonryHorizontal</h2>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<h3 id='masonryHorizontal-options'>Options</h3>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>rowHeight</code></dt>
|
||||
<dd class='option-type'>Integer</dd>
|
||||
</dl>
|
||||
<p>The width of one column in the grid. If no value is set for <code>rowHeight</code>, default is the height of the first item element.</p>
|
||||
|
||||
<h3 id='masonryHorizontal-example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>masonryHorizontal</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>rowHeight</span> <span class='o'>:</span> <span class='mi'>360</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='straightacross'>straightAcross</h2>
|
||||
|
||||
<p>Item elements are arranged horizontally left to right. Useful for simple lists.</p>
|
||||
|
||||
<h2 id='straightdown'>straightDown</h2>
|
||||
|
||||
<p>Item elements are arranged vertically top to bottom. Useful for simple lists.</p>
|
||||
|
||||
<h2 id='horizontal_layouts'>Horizontal layouts</h2>
|
||||
|
||||
<p>Horizontal layout modes (masonryHorizontal, fitColumns, cellsByColumn, and straightAcross) need a container that has a height value. Be sure that your CSS has height set.</p>
|
||||
<div class='highlight'><pre><code class='css'><span class='nf'>#container</span> <span class='p'>{</span>
|
||||
<span class='c'>/* either of these will work for horizontal Isotope layouts */</span>
|
||||
<span class='k'>height</span><span class='o'>:</span> <span class='m'>80</span><span class='o'>%</span><span class='p'>;</span>
|
||||
<span class='k'>height</span><span class='o'>:</span> <span class='m'>480px</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='modified_layout_modes'>Modified layout modes</h2>
|
||||
|
||||
<p><a href='extending-isotope.html'>Isotope’s methods can be extended and overwritten</a> to shim-in additional functionality. See these modified layout modes:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href='../custom-layout-modes/centered-masonry.html'><strong>Centered masonry</strong></a></li>
|
||||
|
||||
<li><a href='../custom-layout-modes/masonry-corner-stamp.html'><strong>Masonry corner stamp</strong></a></li>
|
||||
|
||||
<li><a href='../custom-layout-modes/masonry-gutters.html'><strong>Masonry gutters</strong></a></li>
|
||||
</ul>
|
||||
|
||||
<p>To use these mods, copy the revised methods found in the demos’ page source. They look like:</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>.</span><span class='nx'>Isotope</span><span class='p'>.</span><span class='nx'>prototype</span><span class='p'>.</span><span class='nx'>_masonryReset</span> <span class='o'>=</span> <span class='kd'>function</span><span class='p'>()</span> <span class='p'>{</span>
|
||||
<span class='c1'>// modified code..</span>
|
||||
<span class='p'>};</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
215
sites/all/libraries/isotope-site/docs/license.html
Normal file
215
sites/all/libraries/isotope-site/docs/license.html
Normal file
@@ -0,0 +1,215 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>License · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">License</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#isotope_commercial_license_agreement">Isotope Commercial License Agreement</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>License</h1>
|
||||
|
||||
|
||||
<p>Isotope may be used in non-commercial and personal applications for free.</p>
|
||||
|
||||
<p>For commercial applications, you may license Isotope with the purchase of a one-time fee per developer seat (how many of you will be developing with Isotope) . <a href='http://metafizzy.co/#isotope-license'>Commercial licenses may be purchased at metafizzy.co</a>.</p>
|
||||
|
||||
<p>In short, with a purchase of a commercial license:</p>
|
||||
|
||||
<ul>
|
||||
<li>Once purchased, you may use Isotope in all your future commercial applications.</li>
|
||||
|
||||
<li>You may use Isotope in your own commercial applications, i.e. WordPress, Tumblr, or other CMS themes or templates.</li>
|
||||
|
||||
<li>Customers of your products <em>do not</em> need to purchase their own license.</li>
|
||||
</ul>
|
||||
|
||||
<p>Copyright © 2011 David DeSandro / Metafizzy LLC</p>
|
||||
|
||||
<h2 id='isotope_commercial_license_agreement'>Isotope Commercial License Agreement</h2>
|
||||
|
||||
<p>This Commercial License Agreement (the <strong>Agreement</strong>) is a binding legal agreement between you and Metafizzy LLC (<strong>Metafizzy</strong>). By installing, copying, or using Isotope (the <strong>Software</strong>), you agree to be bound by these terms of this Agreement.</p>
|
||||
|
||||
<h3 id='usage'>Usage</h3>
|
||||
|
||||
<p>This Agreement grants a non-exclusive, non-transferable license to use the Software to design and develop software (<strong>Applications</strong>).</p>
|
||||
|
||||
<p>You are granted 1 license for you as 1 designated user to use the Software for the purpose of developing Applications (<strong>Developer</strong>). You must purchase another separate license to the Software for each and any additional Developer. For example, if your company has 5 developers using the Software, you need to purchase 5 licenses.</p>
|
||||
|
||||
<p>You are granted the right to use and to modify the source code of the Software for use in Applications. You own any original work authored by you; Metafizzy continues to retain all copyright and other intellectual property rights in the Software. You are not permitted to move, remove, edit, or obscure any copyright, trademark, attribution, warning or disclaimer notices in the Software.</p>
|
||||
|
||||
<p>You may use the Software only to create Applications that are significantly different than and do not compete with the Software. You are granted the license to distribute the Software as part of your Applications on a royalty-free basis. Users of your Applications are permitted to use the Software or your modifications of the Software for development purposes.</p>
|
||||
|
||||
<h3 id='warranties_and_remedies'>Warranties and Remedies</h3>
|
||||
|
||||
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. METAFIZZY’S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY UNDER THIS AGREEMENT SHALL BE RETURN OF THE PRICE PAID FOR THE SOFTWARE.</p>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
286
sites/all/libraries/isotope-site/docs/methods.html
Normal file
286
sites/all/libraries/isotope-site/docs/methods.html
Normal file
@@ -0,0 +1,286 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Methods · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Methods</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#additems">addItems</a></li>
|
||||
|
||||
<li><a href="#appended">appended</a></li>
|
||||
|
||||
<li><a href="#destroy">destroy</a></li>
|
||||
|
||||
<li><a href="#insert">insert</a></li>
|
||||
|
||||
<li><a href="#layout">layout</a></li>
|
||||
|
||||
<li><a href="#option">option</a></li>
|
||||
|
||||
<li><a href="#relayout">reLayout</a></li>
|
||||
|
||||
<li><a href="#reloaditems">reloadItems</a></li>
|
||||
|
||||
<li><a href="#remove">remove</a></li>
|
||||
|
||||
<li><a href="#shuffle">shuffle</a></li>
|
||||
|
||||
<li><a href="#updatesortdata">updateSortData</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Methods</h1>
|
||||
|
||||
|
||||
<p>Isotope offers several methods to extend functionality. Isotope’s methods follow the jQuery UI pattern.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'methodName'</span><span class='p'>,</span> <span class='p'>[</span><span class='nx'>optionalParameters</span><span class='p'>]</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='additems'>addItems</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'addItems'</span><span class='p'>,</span> <span class='nx'>$items</span><span class='p'>,</span> <span class='nx'>callback</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Adds item elements to the pool of item elements of the container, but does sort, filter or layout. See <a href='adding-items.html'>Adding items</a> for more details. The argument within the callback is the group of elements that were added.</p>
|
||||
|
||||
<p><a href='../demos/adding-items.html'><strong>See Demo: Adding items</strong></a></p>
|
||||
|
||||
<h2 id='appended'>appended</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'appended'</span><span class='p'>,</span> <span class='nx'>$items</span><span class='p'>,</span> <span class='nx'>callback</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Adds item elements via <code>addItems</code> method, then triggers <code>layout</code> just for those new elements. Useful for Infinite Scroll. See <a href='adding-items.html'>Adding items</a> for more details.</p>
|
||||
|
||||
<p><a href='../demos/adding-items.html'><strong>See Demo: Adding items</strong></a></p>
|
||||
|
||||
<h2 id='destroy'>destroy</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'destroy'</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Removes Isotope functionality completely. Returns element back to pre-init state.</p>
|
||||
|
||||
<h2 id='insert'>insert</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'insert'</span><span class='p'>,</span> <span class='nx'>$items</span><span class='p'>,</span> <span class='nx'>callback</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Appends items elements to container, adds items to via <code>addItems</code> method, and then triggers <code>reLayout</code> method so new elements are properly filtered, sorted and laid-out. See <a href='adding-items.html'>Adding items</a> for more details.</p>
|
||||
|
||||
<p><a href='../demos/adding-items.html'><strong>See Demo: Adding items</strong></a>.</p>
|
||||
|
||||
<h2 id='layout'>layout</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'layout'</span><span class='p'>,</span> <span class='nx'>$items</span><span class='p'>,</span> <span class='nx'>callback</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Positions specified item elements in layout.</p>
|
||||
|
||||
<p><code>layout</code> will only position specified elements, and those elements will be positioned at the end of layout. Whereas <code>reLayout</code> will position all elements in the Isotope widget.</p>
|
||||
|
||||
<h2 id='option'>option</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'option'</span><span class='p'>,</span> <span class='nx'>options</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Sets options for plugin instance. Unlike passing options through <code>.isotope()</code>, using the <code>option</code> method will not trigger layout.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='c1'>// sets multiple options</span>
|
||||
<span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'option'</span><span class='p'>,</span> <span class='p'>{</span> <span class='nx'>layoutMode</span><span class='o'>:</span> <span class='s1'>'fitRows'</span><span class='p'>,</span> <span class='nx'>filter</span><span class='o'>:</span> <span class='s1'>'.my-filter'</span> <span class='p'>}</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='relayout'>reLayout</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'reLayout'</span><span class='p'>,</span> <span class='nx'>callback</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Resets layout properties and lays-out every item element.</p>
|
||||
|
||||
<p><a href='../demos/relayout.html'><strong>See Demo: reLayout</strong></a></p>
|
||||
|
||||
<h2 id='reloaditems'>reloadItems</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'reloadItems'</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Re-collects all item elements in their current order in the DOM. Useful for prepending.</p>
|
||||
|
||||
<p><a href='../demos/adding-items.html'><strong>See Demo: Adding items</strong></a>.</p>
|
||||
|
||||
<h2 id='remove'>remove</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'remove'</span><span class='p'>,</span> <span class='nx'>$items</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Removes specified item elements from Isotope widget and the DOM.</p>
|
||||
|
||||
<h2 id='shuffle'>shuffle</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'shuffle'</span><span class='p'>,</span> <span class='nx'>callback</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Shuffles order of items. Sets <a href='options.html#sortby'><code>sortBy</code> option</a> to <a href='sorting.html#sortby_option'><code>'random'</code></a>.</p>
|
||||
|
||||
<h2 id='updatesortdata'>updateSortData</h2>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='p'>.</span><span class='nx'>isotope</span><span class='p'>(</span> <span class='s1'>'updateSortData'</span><span class='p'>,</span> <span class='nx'>$items</span> <span class='p'>)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Updates the sorting data on specified item elements. This method is useful if the data within an item is changed dynamically after Isotope has been initialized.</p>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
460
sites/all/libraries/isotope-site/docs/options.html
Normal file
460
sites/all/libraries/isotope-site/docs/options.html
Normal file
@@ -0,0 +1,460 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Options · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs option-def">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Options</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#animationengine">animationEngine</a></li>
|
||||
|
||||
<li><a href="#animationoptions">animationOptions</a></li>
|
||||
|
||||
<li><a href="#containerclass">containerClass</a></li>
|
||||
|
||||
<li><a href="#filter">filter</a></li>
|
||||
|
||||
<li><a href="#getsortdata">getSortData</a></li>
|
||||
|
||||
<li><a href="#hiddenclass">hiddenClass</a></li>
|
||||
|
||||
<li><a href="#hiddenstyle">hiddenStyle</a></li>
|
||||
|
||||
<li><a href="#itemclass">itemClass</a></li>
|
||||
|
||||
<li><a href="#itempositiondataenabled">itemPositionDataEnabled</a></li>
|
||||
|
||||
<li><a href="#itemselector">itemSelector</a></li>
|
||||
|
||||
<li><a href="#layoutmode">layoutMode</a></li>
|
||||
|
||||
<li><a href="#resizable">resizable</a></li>
|
||||
|
||||
<li><a href="#resizescontainer">resizesContainer</a></li>
|
||||
|
||||
<li><a href="#sortascending">sortAscending</a></li>
|
||||
|
||||
<li><a href="#sortby">sortBy</a></li>
|
||||
|
||||
<li><a href="#transformsenabled">transformsEnabled</a></li>
|
||||
|
||||
<li><a href="#visiblestyle">visibleStyle</a></li>
|
||||
|
||||
<li><a href="#layoutspecific_options">Layout-specific options</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Options</h1>
|
||||
|
||||
|
||||
<dl class='header clearfix'>
|
||||
<dt><code>option</code></dt>
|
||||
<dd class='option-type'>Type</dd>
|
||||
<dd class='default'>Default</dd>
|
||||
</dl>
|
||||
<h2 id='animationengine'>animationEngine</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>animationEngine</code></dt>
|
||||
<dd class='option-type'>String</dd>
|
||||
<dd class='default'><code><span class='s1'>'best-available'</span></code></dd>
|
||||
</dl>
|
||||
<p>Determines the jQuery method to apply styles, <code>.css()</code> or <code>.animate()</code>. Useful for relying on CSS transitions to handle animation.</p>
|
||||
|
||||
<h3 id='animationEngine-values'>Values</h3>
|
||||
|
||||
<ul>
|
||||
<li><code>'best-available'</code>: if browser supports CSS transitions, Isotope uses <code>.css()</code>. If not, falls back to using <code>.animate()</code>.</li>
|
||||
|
||||
<li><code>'css'</code>: Isotope uses <code>.css()</code></li>
|
||||
|
||||
<li><code>'jquery'</code>: Isotope uses <code>.animate()</code></li>
|
||||
</ul>
|
||||
|
||||
<h2 id='animationoptions'>animationOptions</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>animationOptions</code></dt>
|
||||
<dd class='option-type'>Object</dd>
|
||||
<dd class='default'><code>{ queue: <span class='kc'>false</span>, duration: <span class='mi'>800</span> }</code></dd>
|
||||
</dl>
|
||||
<p>When jQuery is the animation engine (see above), these options will be used in <code>.animate()</code>. See the <a href='http://api.jquery.com/animate/#animate-properties-options'>jQuery API for animate options</a> for details.</p>
|
||||
|
||||
<h3 id='example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>animationOptions</span><span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>duration</span><span class='o'>:</span> <span class='mi'>750</span><span class='p'>,</span>
|
||||
<span class='nx'>easing</span><span class='o'>:</span> <span class='s1'>'linear'</span><span class='p'>,</span>
|
||||
<span class='nx'>queue</span><span class='o'>:</span> <span class='kc'>false</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='containerclass'>containerClass</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>containerClass</code></dt>
|
||||
<dd class='option-type'>String</dd>
|
||||
<dd class='default'><code><span class='s1'>'isotope'</span></code></dd>
|
||||
</dl>
|
||||
<p>The class applied to the container element.</p>
|
||||
|
||||
<h2 id='filter'>filter</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>filter</code></dt>
|
||||
<dd class='option-type'>Selector</dd>
|
||||
</dl>
|
||||
<p>Setting a filter with show item elements that match the selector, and hide elements that do not match. See <a href='filtering.html'>docs on filering</a> for more details.</p>
|
||||
|
||||
<p><a href='../demos/filtering.html'><strong>See Demo: Filtering</strong></a></p>
|
||||
|
||||
<h3 id='filter-values'>Values</h3>
|
||||
<ul>
|
||||
<li><code><span class='s1'>'*'</span></code> or <code><span class='s1'>''</span></code> (an empty string): Shows all item elements</li>
|
||||
</ul>
|
||||
<h2 id='getsortdata'>getSortData</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>getSortData</code></dt>
|
||||
<dd class='option-type'>Object</dd>
|
||||
</dl>
|
||||
<p>An object containing one or several methods to retrieve data for Sorting. The methods receive one parameter (<code>$elem</code> in the example below) which is a jQuery object representing each item element. The methods need to return a value. See <a href='sorting.html'>docs on sorting</a> for more details.</p>
|
||||
|
||||
<p><a href='../demos/sorting.html'><strong>See Demo: Sorting</strong></a></p>
|
||||
|
||||
<h3 id='example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>getSortData</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>symbol</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>attr</span><span class='p'>(</span><span class='s1'>'data-symbol'</span><span class='p'>);</span>
|
||||
<span class='p'>},</span>
|
||||
<span class='nx'>number</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nb'>parseInt</span><span class='p'>(</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>find</span><span class='p'>(</span><span class='s1'>'.number'</span><span class='p'>).</span><span class='nx'>text</span><span class='p'>(),</span> <span class='mi'>10</span> <span class='p'>);</span>
|
||||
<span class='p'>},</span>
|
||||
<span class='nx'>name</span> <span class='o'>:</span> <span class='kd'>function</span> <span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>find</span><span class='p'>(</span><span class='s1'>'.name'</span><span class='p'>).</span><span class='nx'>text</span><span class='p'>();</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='hiddenclass'>hiddenClass</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>hiddenClass</code></dt>
|
||||
<dd class='option-type'>String</dd>
|
||||
<dd class='default'><code><span class='s1'>'isotope-hidden'</span></code></dd>
|
||||
</dl>
|
||||
<p>The class applied to item elements hidden by Filtering.</p>
|
||||
|
||||
<h2 id='hiddenstyle'>hiddenStyle</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>hiddenStyle</code></dt>
|
||||
<dd class='option-type'>Object</dd>
|
||||
<dd class='default'><code>{ opacity : <span class='mi'>0</span>, scale : <span class='mi'>0.001</span> }</code></dd>
|
||||
</dl>
|
||||
<p>The style applied to item elements hidden by Filtering.</p>
|
||||
|
||||
<h2 id='itemclass'>itemClass</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>itemClass</code></dt>
|
||||
<dd class='option-type'>String</dd>
|
||||
<dd class='default'><code><span class='s1'>'isotope-item'</span></code></dd>
|
||||
</dl>
|
||||
<p>The class applied to item elements.</p>
|
||||
|
||||
<h2 id='itempositiondataenabled'>itemPositionDataEnabled</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>itemPositionDataEnabled</code></dt>
|
||||
<dd class='option-type'>Boolean</dd>
|
||||
<dd class='default'><code><span class='kc'>false</span></code></dd>
|
||||
</dl>
|
||||
<p>When enabled, the position of item elements will exposed as data, which you can retrieve with jQuery’s data method with <code><span class='s1'>'isotope-item-position'</span></code> name space. Position is return as an object with <code>x</code> and <code>y</code>;</p>
|
||||
|
||||
<h3 id='example'>Example</h3>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>itemSelector</span><span class='o'>:</span> <span class='s1'>'.element'</span><span class='p'>,</span>
|
||||
<span class='nx'>itemPositionDataEnabled</span><span class='o'>:</span> <span class='kc'>true</span>
|
||||
<span class='p'>})</span>
|
||||
<span class='c1'>// log position of each item</span>
|
||||
<span class='p'>.</span><span class='nx'>find</span><span class='p'>(</span><span class='s1'>'.element'</span><span class='p'>).</span><span class='nx'>each</span><span class='p'>(</span><span class='kd'>function</span><span class='p'>(){</span>
|
||||
<span class='kd'>var</span> <span class='nx'>position</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='k'>this</span><span class='p'>).</span><span class='nx'>data</span><span class='p'>(</span><span class='s1'>'isotope-item-position'</span><span class='p'>);</span>
|
||||
<span class='nx'>console</span><span class='p'>.</span><span class='nx'>log</span><span class='p'>(</span><span class='s1'>'item position is x: '</span> <span class='o'>+</span> <span class='nx'>position</span><span class='p'>.</span><span class='nx'>x</span> <span class='o'>+</span> <span class='s1'>', y: '</span> <span class='o'>+</span> <span class='nx'>position</span><span class='p'>.</span><span class='nx'>y</span> <span class='p'>);</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='itemselector'>itemSelector</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>itemSelector</code></dt>
|
||||
<dd class='option-type'>Selector</dd>
|
||||
</dl>
|
||||
<p>Restricts Isotope item elements to selector.</p>
|
||||
|
||||
<h2 id='layoutmode'>layoutMode</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>layoutMode</code></dt>
|
||||
<dd class='option-type'>String</dd>
|
||||
<dd class='default'><code><span class='s1'>'masonry'</span></code></dd>
|
||||
</dl>
|
||||
<p>See also docs on <a href='layout-modes.html'>Layout modes</a>.</p>
|
||||
|
||||
<p><a href='../demos/layout-modes.html'><strong>See Demo: Layout modes</strong></a></p>
|
||||
|
||||
<h2 id='resizable'>resizable</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>resizable</code></dt>
|
||||
<dd class='option-type'>Boolean</dd>
|
||||
<dd class='default'><code><span class='kc'>true</span></code></dd>
|
||||
</dl>
|
||||
<p>Triggers layout logic when browser window is resized.</p>
|
||||
|
||||
<h2 id='resizescontainer'>resizesContainer</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>resizesContainer</code></dt>
|
||||
<dd class='option-type'>Boolean</dd>
|
||||
<dd class='default'><code><span class='kc'>true</span></code></dd>
|
||||
</dl>
|
||||
<p>Isotope will set the height (for vertical layout modes) or width (for horizontal layout modes) of the container after layout. If <code>resizesContainer</code> is set to <code><span class='kc'>false</span></code>, be sure to set a size for the container in your CSS, so it doesn’t collapse when Isotope is triggered.</p>
|
||||
|
||||
<h2 id='sortascending'>sortAscending</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>sortAscending</code></dt>
|
||||
<dd class='option-type'>Boolean</dd>
|
||||
<dd class='default'><code><span class='kc'>true</span></code></dd>
|
||||
</dl>
|
||||
<p>Used with sorting. If true, items are sorted ascending: “1, 2, 3” or “A, B, C…”. If false, items are sorted descending “Z, Y, X” or “9, 8, 7…”. See <a href='sorting.html'>docs on sorting</a> for more details.</p>
|
||||
|
||||
<p><a href='../demos/sorting.html'><strong>See Demo: Sorting</strong></a></p>
|
||||
|
||||
<h2 id='sortby'>sortBy</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>sortBy</code></dt>
|
||||
<dd class='option-type'>String</dd>
|
||||
</dl>
|
||||
<p>The property name of the method within the <code>getSortData</code> option to sort item elements. See <a href='sorting.html'>docs on sorting</a> for more details.</p>
|
||||
|
||||
<p><a href='../demos/sorting.html'><strong>See Demo: Sorting</strong></a></p>
|
||||
|
||||
<h3 id='sortBy-values'>Values</h3>
|
||||
|
||||
<ul>
|
||||
<li><code>'original-order'</code> Sorts item elements by their original order.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id='transformsenabled'>transformsEnabled</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>transformsEnabled</code></dt>
|
||||
<dd class='option-type'>Boolean</dd>
|
||||
<dd class='default'><code><span class='kc'>true</span></code></dd>
|
||||
</dl>
|
||||
<p>Isotope uses CSS3 transform to position item elements, when available in the browser. Setting <code>transformsEnabled</code> to <code><span class='kc'>false</span></code> will disable this feature so all browsers use top/left absolute positioning. Useful for <a href='help.html#flash'>resolving issues with Flash content</a>.</p>
|
||||
|
||||
<h3 id='transformsEnabled-css'>Additional CSS</h3>
|
||||
|
||||
<p>If you do disable transforms, but still want to use <a href='animating.html#css_transitions'>CSS transitions</a>, you’ll need add the following CSS:</p>
|
||||
<div class='highlight'><pre><code class='css'><span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
|
||||
<span class='o'>-</span><span class='n'>webkit</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>top</span><span class='o'>,</span> <span class='k'>left</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='o'>-</span><span class='n'>moz</span><span class='o'>-</span><span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>top</span><span class='o'>,</span> <span class='k'>left</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='n'>transition</span><span class='o'>-</span><span class='n'>property</span><span class='o'>:</span> <span class='k'>top</span><span class='o'>,</span> <span class='k'>left</span><span class='o'>,</span> <span class='k'>opacity</span><span class='p'>;</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id='disabling_hidden_and_visible_scale_styles'>Disabling hidden and visible scale styles</h3>
|
||||
|
||||
<p>If you are using filtering, it’s also a good idea to disable the scale transform with the <a href='#hiddenstyle'><code>hiddenStyle</code> option</a> and <a href='#visiblestyle'><code>visibleStyle</code> option</a>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>transformsEnabled</span><span class='o'>:</span> <span class='kc'>false</span><span class='p'>,</span>
|
||||
<span class='nx'>visibleStyle</span><span class='o'>:</span> <span class='p'>{</span> <span class='nx'>opacity</span><span class='o'>:</span> <span class='mi'>1</span> <span class='p'>},</span>
|
||||
<span class='nx'>hiddenStyle</span><span class='o'>:</span> <span class='p'>{</span> <span class='nx'>opacity</span><span class='o'>:</span> <span class='mi'>0</span> <span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='visiblestyle'>visibleStyle</h2>
|
||||
<dl class='clearfix'>
|
||||
<dt><code>visibleStyle</code></dt>
|
||||
<dd class='option-type'>Object</dd>
|
||||
<dd class='default'><code>{ opacity : <span class='mi'>1</span>, scale : <span class='mi'>1</span> }</code></dd>
|
||||
</dl>
|
||||
<p>The style applied to item elements made visible by Filtering.</p>
|
||||
|
||||
<h2 id='layoutspecific_options'>Layout-specific options</h2>
|
||||
|
||||
<p>In addition the general options listed above, certain layout modes each have their own options. In order to avoid conflict, these options are set with an option that matches the name of the layout mode.</p>
|
||||
|
||||
<p>See docs on <a href='layout-modes.html'>layout modes</a> for each layout mode’s available options.</p>
|
||||
|
||||
<p>For example, if your layout switched from <code>masonry</code> to <code>cellsByRow</code>:</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>masonry</span><span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>columnWidth</span><span class='o'>:</span> <span class='mi'>120</span>
|
||||
<span class='p'>},</span>
|
||||
<span class='nx'>cellsByRow</span><span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>columnWidth</span><span class='o'>:</span> <span class='mi'>220</span><span class='p'>,</span>
|
||||
<span class='nx'>rowHeight</span><span class='o'>:</span> <span class='mi'>220</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p><a href='../demos/layout-modes.html'><strong>See Demo: Layout modes</strong></a></p>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
311
sites/all/libraries/isotope-site/docs/sorting.html
Normal file
311
sites/all/libraries/isotope-site/docs/sorting.html
Normal file
@@ -0,0 +1,311 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Sorting · Isotope Docs</title>
|
||||
|
||||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
|
||||
<!-- scripts at bottom of page -->
|
||||
|
||||
</head>
|
||||
<body class="docs ">
|
||||
|
||||
<nav id="site-nav">
|
||||
<h1><a href="../index.html">Isotope</a></h1>
|
||||
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../docs/introduction.html">Introduction</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/options.html">Options</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/methods.html">Methods</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li class="current"><a href="#content">Sorting</a>
|
||||
<ul class="toc">
|
||||
|
||||
<li><a href="#markup">Markup</a></li>
|
||||
|
||||
<li><a href="#getsortdata_option">getSortData option</a></li>
|
||||
|
||||
<li><a href="#sortby_option">sortBy option</a></li>
|
||||
|
||||
<li><a href="#sortascending_option">sortAscending option</a></li>
|
||||
|
||||
<li><a href="#creating_interactive_buttons">Creating interactive buttons</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/animating.html">Animating</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/extending-isotope.html">Extending Isotope</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/help.html">Help</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../docs/license.html">License</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Demos</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../demos/basic.html">Basic</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-complete.html">Elements Complete</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/elements-partial.html">Elements Partial</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/layout-modes.html">Layout modes</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/filtering.html">Filtering</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/sorting.html">Sorting</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/relayout.html">reLayout</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/adding-items.html">Adding items</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/images.html">Images</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/combination-filters.html">Combination filters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/hash-history.html">Hash history</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Custom layout modes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
|
||||
|
||||
|
||||
|
||||
<li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a href="../tests/index.html">Tests</a></h2>
|
||||
|
||||
</nav> <!-- #site-nav -->
|
||||
|
||||
<section id="content">
|
||||
|
||||
<h1>Sorting</h1>
|
||||
|
||||
|
||||
<p>Collect data from item element and rearrange their order in the layout with sorting.</p>
|
||||
|
||||
<p><a href='../demos/sorting.html'><strong>See Demo: Sorting</strong></a></p>
|
||||
|
||||
<h2 id='markup'>Markup</h2>
|
||||
|
||||
<p>Any group of similar items have their own data. It could be a text value, like a title or tag, or a numerical value, like a measurement or grade. For our example, each item element has several data points that can be used for sorting. There’s the elemental symbol, number, name of the element, weight, and category.</p>
|
||||
<div class='highlight'><pre><code class='html'><span class='nt'><div</span> <span class='na'>id=</span><span class='s'>"container"</span><span class='nt'>></span>
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element transition metal"</span> <span class='na'>data-category=</span><span class='s'>"transition"</span><span class='nt'>></span>
|
||||
<span class='nt'><p</span> <span class='na'>class=</span><span class='s'>"number"</span><span class='nt'>></span>79<span class='nt'></p></span>
|
||||
<span class='nt'><h3</span> <span class='na'>class=</span><span class='s'>"symbol"</span><span class='nt'>></span>Au<span class='nt'></h3></span>
|
||||
<span class='nt'><h2</span> <span class='na'>class=</span><span class='s'>"name"</span><span class='nt'>></span>Gold<span class='nt'></h2></span>
|
||||
<span class='nt'><p</span> <span class='na'>class=</span><span class='s'>"weight"</span><span class='nt'>></span>196.966569<span class='nt'></p></span>
|
||||
<span class='nt'></div></span>
|
||||
|
||||
<span class='nt'><div</span> <span class='na'>class=</span><span class='s'>"element metalloid"</span> <span class='na'>data-category=</span><span class='s'>"metalloid"</span><span class='nt'>></span>
|
||||
<span class='nt'><p</span> <span class='na'>class=</span><span class='s'>"number"</span><span class='nt'>></span>51<span class='nt'></p></span>
|
||||
<span class='nt'><h3</span> <span class='na'>class=</span><span class='s'>"symbol"</span><span class='nt'>></span>Sb<span class='nt'></h3></span>
|
||||
<span class='nt'><h2</span> <span class='na'>class=</span><span class='s'>"name"</span><span class='nt'>></span>Antimony<span class='nt'></h2></span>
|
||||
<span class='nt'><p</span> <span class='na'>class=</span><span class='s'>"weight"</span><span class='nt'>></span>121.76<span class='nt'></p></span>
|
||||
<span class='nt'></div></span>
|
||||
<span class='nt'></div></span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='getsortdata_option'>getSortData option</h2>
|
||||
|
||||
<p>In order to extract this data from the element, we need to pass in a function to get it via the <a href='options.html#getsortdata'><code>getSortData</code></a> option. This option accepts an object, whose values are the functions to extract the data.</p>
|
||||
|
||||
<p>Each function receives one argument, which represents a jQuery object for each item element. With that argument, the function needs to return the data point.</p>
|
||||
|
||||
<p>In the example above, to get element name, we would need to get the text from the <code>.name</code> element. The same works for symbol.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>getSortData</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='nx'>name</span> <span class='o'>:</span> <span class='kd'>function</span> <span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>find</span><span class='p'>(</span><span class='s1'>'.name'</span><span class='p'>).</span><span class='nx'>text</span><span class='p'>();</span>
|
||||
<span class='p'>},</span>
|
||||
<span class='nx'>symbol</span> <span class='o'>:</span> <span class='kd'>function</span> <span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>find</span><span class='p'>(</span><span class='s1'>'.symbol'</span><span class='p'>).</span><span class='nx'>text</span><span class='p'>();</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>For numerical data, we can convert a text value into a number with <code>parseInt()</code> or <code>parseFloat()</code>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>getSortData</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='c1'>// ...</span>
|
||||
<span class='nx'>number</span> <span class='o'>:</span> <span class='kd'>function</span> <span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nb'>parseInt</span><span class='p'>(</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>find</span><span class='p'>(</span><span class='s1'>'.name'</span><span class='p'>).</span><span class='nx'>text</span><span class='p'>(),</span> <span class='mi'>10</span> <span class='p'>);</span>
|
||||
<span class='p'>},</span>
|
||||
<span class='nx'>weight</span> <span class='o'>:</span> <span class='kd'>function</span> <span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nb'>parseFloat</span><span class='p'>(</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>find</span><span class='p'>(</span><span class='s1'>'.weight'</span><span class='p'>).</span><span class='nx'>text</span><span class='p'>()</span> <span class='p'>);</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>The data extracted can be anything accessible in the item element via jQuery. To extract the category data held within the <code>data-category</code> attribute, we can use the <code>.attr()</code>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>getSortData</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='c1'>// ...</span>
|
||||
<span class='nx'>category</span> <span class='o'>:</span> <span class='kd'>function</span> <span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>attr</span><span class='p'>(</span><span class='s1'>'data-category'</span><span class='p'>);</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Get creative! You could sort a list by the width of each item element.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>getSortData</span> <span class='o'>:</span> <span class='p'>{</span>
|
||||
<span class='c1'>// ...</span>
|
||||
<span class='nx'>width</span> <span class='o'>:</span> <span class='kd'>function</span><span class='p'>(</span> <span class='nx'>$elem</span> <span class='p'>)</span> <span class='p'>{</span>
|
||||
<span class='k'>return</span> <span class='nx'>$elem</span><span class='p'>.</span><span class='nx'>width</span><span class='p'>();</span>
|
||||
<span class='p'>}</span>
|
||||
<span class='p'>}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='sortby_option'>sortBy option</h2>
|
||||
|
||||
<p>For every method set in <code>getSortData</code>, Isotope uses that method to build the data for sorting. The data cache is built on initialization so it can be quickly accessed when sorting. With the methods above, we have built data for an item elements name, symbol, number, weight and category.</p>
|
||||
|
||||
<p>Sorting elements is done with the <a href='options.html#sortby'><code>sortBy</code> option</a>. The value needs to match the property name used in the <code>getSortData</code> object.</p>
|
||||
|
||||
<p>With our example, we can use <code>'name'</code>, <code>'symbol'</code>, <code>'number'</code>, <code>'weight'</code> and <code>'category'</code>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span> <span class='nx'>sortBy</span> <span class='o'>:</span> <span class='s1'>'symbol'</span> <span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>There are two additional sorting data methods built in to Isotope.</p>
|
||||
|
||||
<ul>
|
||||
<li><code>'original-order'</code> will use the original order of the item elements to arrange them in the layout.</li>
|
||||
|
||||
<li><code>'random'</code> is a random order.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id='sortascending_option'>sortAscending option</h2>
|
||||
|
||||
<p>By default, Isotope sorts data in ascension. If our data for name is “Gold, Antimony, Lead, Iron, Silver”, when sorted by name, the elements will be ordered ABC.. : “Antimony, Gold, Iron, Lead, Silver.” To reverse the order and sort data in descension, set <a href='options.html#sortascending'><code>sortAscending</code></a> to <code><span class='kc'>false</span></code>.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
|
||||
<span class='nx'>sortBy</span> <span class='o'>:</span> <span class='s1'>'name'</span><span class='p'>,</span>
|
||||
<span class='nx'>sortAscending</span> <span class='o'>:</span> <span class='kc'>false</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id='creating_interactive_buttons'>Creating interactive buttons</h2>
|
||||
|
||||
<p>We can use a simple list for our buttons.</p>
|
||||
<div class='highlight'><pre><code class='html'><span class='nt'><ul</span> <span class='na'>id=</span><span class='s'>"sort-by"</span><span class='nt'>></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#name"</span><span class='nt'>></span>name<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#symbol"</span><span class='nt'>></span>symbol<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#number"</span><span class='nt'>></span>number<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#weight"</span><span class='nt'>></span>weight<span class='nt'></a></li></span>
|
||||
<span class='nt'><li><a</span> <span class='na'>href=</span><span class='s'>"#category"</span><span class='nt'>></span>category<span class='nt'></a></li></span>
|
||||
<span class='nt'></ul></span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>When one of these links is clicked, we can use the <code>href</code> attribute as the value for <code>sortBy</code> in the Isotope script.</p>
|
||||
<div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#sort-by a'</span><span class='p'>).</span><span class='nx'>click</span><span class='p'>(</span><span class='kd'>function</span><span class='p'>(){</span>
|
||||
<span class='c1'>// get href attribute, minus the '#'</span>
|
||||
<span class='kd'>var</span> <span class='nx'>sortName</span> <span class='o'>=</span> <span class='nx'>$</span><span class='p'>(</span><span class='k'>this</span><span class='p'>).</span><span class='nx'>attr</span><span class='p'>(</span><span class='s1'>'href'</span><span class='p'>).</span><span class='nx'>slice</span><span class='p'>(</span><span class='mi'>1</span><span class='p'>);</span>
|
||||
<span class='nx'>$</span><span class='p'>(</span><span class='s1'>'#container'</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span> <span class='nx'>sortBy</span> <span class='o'>:</span> <span class='nx'>sortName</span> <span class='p'>});</span>
|
||||
<span class='k'>return</span> <span class='kc'>false</span><span class='p'>;</span>
|
||||
<span class='p'>});</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
|
||||
</footer>
|
||||
|
||||
</section> <!-- #content -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user