introduction.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Introduction &middot; Isotope Docs</title>
  6. <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  7. <link rel="stylesheet" href="../css/style.css" />
  8. <!-- scripts at bottom of page -->
  9. </head>
  10. <body class="docs ">
  11. <nav id="site-nav">
  12. <h1><a href="../index.html">Isotope</a></h1>
  13. <h2>Docs</h2>
  14. <ul>
  15. <li class="current"><a href="#content">Introduction</a>
  16. <ul class="toc">
  17. <li><a href="#features">Features</a></li>
  18. <li><a href="#licensing">Licensing</a></li>
  19. <li><a href="#getting_started">Getting started</a></li>
  20. <li><a href="#code_repository">Code repository</a></li>
  21. <li><a href="#moderation">A word about moderation</a></li>
  22. <li><a href="#acknowledgments">Acknowledgments</a></li>
  23. </ul>
  24. </li>
  25. <li><a href="../docs/options.html">Options</a>
  26. <li><a href="../docs/methods.html">Methods</a>
  27. <li><a href="../docs/layout-modes.html">Layout modes</a>
  28. <li><a href="../docs/filtering.html">Filtering</a>
  29. <li><a href="../docs/sorting.html">Sorting</a>
  30. <li><a href="../docs/animating.html">Animating</a>
  31. <li><a href="../docs/adding-items.html">Adding items</a>
  32. <li><a href="../docs/extending-isotope.html">Extending Isotope</a>
  33. <li><a href="../docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
  34. <li><a href="../docs/help.html">Help</a>
  35. <li><a href="../docs/license.html">License</a>
  36. </ul>
  37. <h2>Demos</h2>
  38. <ul>
  39. <li><a href="../demos/basic.html">Basic</a>
  40. <li><a href="../demos/elements-complete.html">Elements Complete</a>
  41. <li><a href="../demos/elements-partial.html">Elements Partial</a>
  42. <li><a href="../demos/layout-modes.html">Layout modes</a>
  43. <li><a href="../demos/filtering.html">Filtering</a>
  44. <li><a href="../demos/sorting.html">Sorting</a>
  45. <li><a href="../demos/relayout.html">reLayout</a>
  46. <li><a href="../demos/adding-items.html">Adding items</a>
  47. <li><a href="../demos/infinite-scroll.html">Infinite Scroll</a>
  48. <li><a href="../demos/images.html">Images</a>
  49. <li><a href="../demos/combination-filters.html">Combination filters</a>
  50. <li><a href="../demos/hash-history.html">Hash history</a>
  51. <li><a href="../demos/fluid-responsive.html">Fluid / responsive</a>
  52. </ul>
  53. <h2>Custom layout modes</h2>
  54. <ul>
  55. <li><a href="../custom-layout-modes/centered-masonry.html">Centered Masonry</a>
  56. <li><a href="../custom-layout-modes/category-rows.html">Category rows</a>
  57. <li><a href="../custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
  58. <li><a href="../custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
  59. <li><a href="../custom-layout-modes/spine-align.html">Spine align</a>
  60. </ul>
  61. <h2><a href="../tests/index.html">Tests</a></h2>
  62. </nav> <!-- #site-nav -->
  63. <section id="content">
  64. <h1>Introduction</h1>
  65. <p class='tagline'>Isotope: An exquisite jQuery plugin for magical layouts</p>
  66. <h2 id='features'>Features</h2>
  67. <ul>
  68. <li><a href='layout-modes.html'><strong>Layout modes</strong></a>: Intelligent, dynamic layouts that can&#8217;t be achieved with CSS alone.</li>
  69. <li><a href='filtering.html'><strong>Filtering</strong></a>: Hide and reveal item elements easily with jQuery selectors.</li>
  70. <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>
  71. <li><strong>Interoperability</strong>: features can be utilized together for a cohesive experience.</li>
  72. <li><strong>Progressive enhancement</strong>: Isotope&#8217;s <a href='animating.html'>animation engine</a> takes advantage of the best browser features when available &#8212; CSS transitions and transforms, GPU acceleration &#8212; but will also fall back to JavaScript animation for lesser browsers.</li>
  73. </ul>
  74. <h2 id='licensing'>Licensing</h2>
  75. <p id='commercial'>
  76. <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 &mdash; portfolio sites, premium templates, etc. Commercial licenses may be purchased at <a href='http://metafizzy.co/#isotope-license'>metafizzy.co</a>.
  77. </p>
  78. <p>Use in non-commercial and personal applications is free.</p>
  79. <h2 id='getting_started'>Getting started</h2>
  80. <p>Isotope requires jQuery 1.4.3 and greater.</p>
  81. <h3 id='markup'>Markup</h3>
  82. <p>Isotope works on a container element with a group of similar child items.</p>
  83. <div class='highlight'><pre><code class='html'><span class='nt'>&lt;div</span> <span class='na'>id=</span><span class='s'>&quot;container&quot;</span><span class='nt'>&gt;</span>
  84. <span class='nt'>&lt;div</span> <span class='na'>class=</span><span class='s'>&quot;item&quot;</span><span class='nt'>&gt;</span>...<span class='nt'>&lt;/div&gt;</span>
  85. <span class='nt'>&lt;div</span> <span class='na'>class=</span><span class='s'>&quot;item&quot;</span><span class='nt'>&gt;</span>...<span class='nt'>&lt;/div&gt;</span>
  86. <span class='nt'>&lt;div</span> <span class='na'>class=</span><span class='s'>&quot;item&quot;</span><span class='nt'>&gt;</span>...<span class='nt'>&lt;/div&gt;</span>
  87. ...
  88. <span class='nt'>&lt;/div&gt;</span>
  89. </code></pre>
  90. </div>
  91. <h3 id='script'>Script</h3>
  92. <div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>&#39;#container&#39;</span><span class='p'>).</span><span class='nx'>isotope</span><span class='p'>({</span>
  93. <span class='c1'>// options</span>
  94. <span class='nx'>itemSelector</span> <span class='o'>:</span> <span class='s1'>&#39;.item&#39;</span><span class='p'>,</span>
  95. <span class='nx'>layoutMode</span> <span class='o'>:</span> <span class='s1'>&#39;fitRows&#39;</span>
  96. <span class='p'>});</span>
  97. </code></pre>
  98. </div>
  99. <p><a href='../demos/basic.html'><strong>See Demo: Basic</strong></a></p>
  100. <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>
  101. <p>Additionally you can specify a callback after the options object. This function will be triggered after the animation has completed.</p>
  102. <div class='highlight'><pre><code class='javascript'><span class='nx'>$</span><span class='p'>(</span><span class='s1'>&#39;#container&#39;</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'>&#39;.my-selector&#39;</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>
  103. <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'>&#39;id&#39;</span><span class='p'>),</span>
  104. <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>
  105. <span class='nx'>console</span><span class='p'>.</span><span class='nx'>log</span><span class='p'>(</span> <span class='s1'>&#39;Isotope has filtered for &#39;</span> <span class='o'>+</span> <span class='nx'>len</span> <span class='o'>+</span> <span class='s1'>&#39; items in #&#39;</span> <span class='o'>+</span> <span class='nx'>id</span> <span class='p'>);</span>
  106. <span class='p'>});</span>
  107. </code></pre>
  108. </div>
  109. <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>
  110. <h3 id='css'>CSS</h3>
  111. <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>
  112. <div class='highlight'><pre><code class='css'><span class='c'>/**** Isotope Filtering ****/</span>
  113. <span class='nc'>.isotope-item</span> <span class='p'>{</span>
  114. <span class='k'>z-index</span><span class='o'>:</span> <span class='m'>2</span><span class='p'>;</span>
  115. <span class='p'>}</span>
  116. <span class='nc'>.isotope-hidden.isotope-item</span> <span class='p'>{</span>
  117. <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>
  118. <span class='k'>z-index</span><span class='o'>:</span> <span class='m'>1</span><span class='p'>;</span>
  119. <span class='p'>}</span>
  120. <span class='c'>/**** Isotope CSS3 transitions ****/</span>
  121. <span class='nc'>.isotope</span><span class='o'>,</span>
  122. <span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
  123. <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>
  124. <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>
  125. <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>
  126. <span class='p'>}</span>
  127. <span class='nc'>.isotope</span> <span class='p'>{</span>
  128. <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>
  129. <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>
  130. <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>
  131. <span class='p'>}</span>
  132. <span class='nc'>.isotope</span> <span class='nc'>.isotope-item</span> <span class='p'>{</span>
  133. <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>
  134. <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>
  135. <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>
  136. <span class='p'>}</span>
  137. <span class='c'>/**** disabling Isotope CSS3 transitions ****/</span>
  138. <span class='nc'>.isotope.no-transition</span><span class='o'>,</span>
  139. <span class='nc'>.isotope.no-transition</span> <span class='nc'>.isotope-item</span><span class='o'>,</span>
  140. <span class='nc'>.isotope</span> <span class='nc'>.isotope-item.no-transition</span> <span class='p'>{</span>
  141. <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>
  142. <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>
  143. <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>
  144. <span class='p'>}</span>
  145. </code></pre>
  146. </div>
  147. <h2 id='code_repository'>Code repository</h2>
  148. <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>
  149. <h2 id='moderation'>A word about moderation</h2>
  150. <p>Isotope enables a wealth of functionality. But just because you can take advantage of its numerous features together, doesn&#8217;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>
  151. <h2 id='acknowledgments'>Acknowledgments</h2>
  152. <ul>
  153. <li><a href='http://benalman.com/'><strong>&#8220;Cowboy&#8221; Ben Alman</strong></a> for <a href='http://benalman.com/projects/jquery-bbq-plugin/'>jQuery BBQ</a> (included with docs)</li>
  154. <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&#8217;s CSS hooks</li>
  155. <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>
  156. <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>
  157. <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>
  158. <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>
  159. <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>
  160. <li>The Modernizr team for <a href='http://www.modernizr.com/'>Modernizr</a> (partially used within Isotope)</li>
  161. <li><a href='http://perfectionkills.com'><strong>Juriy Zaytsev aka &#8220;kangax&#8221;</strong></a> for <a href='http://perfectionkills.com/feature-testing-css-properties/'>getStyleProperty</a> (used within Isotope)</li>
  162. </ul>
  163. <footer>
  164. Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
  165. </footer>
  166. </section> <!-- #content -->
  167. </body>
  168. </html>