index.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Isotope</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="homepage ">
  11. <nav id="site-nav">
  12. <h1><a href="index.html">Isotope</a></h1>
  13. <h2>Docs</h2>
  14. <ul>
  15. <li><a href="./docs/introduction.html">Introduction</a>
  16. <li><a href="./docs/options.html">Options</a>
  17. <li><a href="./docs/methods.html">Methods</a>
  18. <li><a href="./docs/layout-modes.html">Layout modes</a>
  19. <li><a href="./docs/filtering.html">Filtering</a>
  20. <li><a href="./docs/sorting.html">Sorting</a>
  21. <li><a href="./docs/animating.html">Animating</a>
  22. <li><a href="./docs/adding-items.html">Adding items</a>
  23. <li><a href="./docs/extending-isotope.html">Extending Isotope</a>
  24. <li><a href="./docs/hash-history-jquery-bbq.html">Hash history with jQuery BBQ</a>
  25. <li><a href="./docs/help.html">Help</a>
  26. <li><a href="./docs/license.html">License</a>
  27. </ul>
  28. <h2>Demos</h2>
  29. <ul>
  30. <li><a href="./demos/basic.html">Basic</a>
  31. <li><a href="./demos/elements-complete.html">Elements Complete</a>
  32. <li><a href="./demos/elements-partial.html">Elements Partial</a>
  33. <li><a href="./demos/layout-modes.html">Layout modes</a>
  34. <li><a href="./demos/filtering.html">Filtering</a>
  35. <li><a href="./demos/sorting.html">Sorting</a>
  36. <li><a href="./demos/relayout.html">reLayout</a>
  37. <li><a href="./demos/adding-items.html">Adding items</a>
  38. <li><a href="./demos/infinite-scroll.html">Infinite Scroll</a>
  39. <li><a href="./demos/images.html">Images</a>
  40. <li><a href="./demos/combination-filters.html">Combination filters</a>
  41. <li><a href="./demos/hash-history.html">Hash history</a>
  42. <li><a href="./demos/fluid-responsive.html">Fluid / responsive</a>
  43. </ul>
  44. <h2>Custom layout modes</h2>
  45. <ul>
  46. <li><a href="./custom-layout-modes/centered-masonry.html">Centered Masonry</a>
  47. <li><a href="./custom-layout-modes/category-rows.html">Category rows</a>
  48. <li><a href="./custom-layout-modes/masonry-corner-stamp.html">Masonry corner stamp</a>
  49. <li><a href="./custom-layout-modes/masonry-gutters.html">Masonry gutters</a>
  50. <li><a href="./custom-layout-modes/spine-align.html">Spine align</a>
  51. </ul>
  52. <h2><a href="tests/index.html">Tests</a></h2>
  53. </nav> <!-- #site-nav -->
  54. <section id="content">
  55. <section id="options" class="clearfix">
  56. <div class="option-combo">
  57. <h2>Filter:</h2>
  58. <ul id="filter" class="option-set clearfix" data-option-key="filter">
  59. <li><a href="#show-all" data-option-value="*" class="selected">show all</a></li>
  60. <li><a href="#elements" data-option-value=".element:not(.feature)">elements</a></li>
  61. <li><a href="#features" data-option-value=".feature">features</a></li>
  62. <li><a href="#examples" data-option-value=".example">examples</a></li>
  63. </ul>
  64. </div>
  65. <div class="option-combo">
  66. <h2>Sort:</h2>
  67. <ul id="sort" class="option-set clearfix" data-option-key="sortBy">
  68. <li><a href="#mixed" data-option-value="number" class="selected">mixed</a></li>
  69. <li><a href="#original" data-option-value="original-order">original</a></li>
  70. <li><a href="#alphabetical" data-option-value="alphabetical">alphabetical</a></li>
  71. </ul>
  72. </div>
  73. <div class="option-combo">
  74. <h2>Layout: </h2>
  75. <ul id="layouts" class="option-set clearfix" data-option-key="layoutMode">
  76. <li><a href="#masonry" data-option-value="masonry" class="selected">masonry</a></li>
  77. <li><a href="#fitRows" data-option-value="fitRows">fitRows</a></li>
  78. <li><a href="#straightDown" data-option-value="straightDown">straightDown</a></li>
  79. </ul>
  80. </div>
  81. </section>
  82. <div id="container" class="super-list variable-sizes clearfix">
  83. <div class="element alkaline-earth metal " data-symbol="Mg" data-category="alkaline-earth">
  84. <p class="number">12</p>
  85. <h3 class="symbol">Mg</h3>
  86. <h2 class="name">Magnesium</h2>
  87. <p class="weight">24.305</p>
  88. </div>
  89. <div class="element actinoid metal inner-transition " data-symbol="U" data-category="actinoid">
  90. <p class="number">92</p>
  91. <h3 class="symbol">U</h3>
  92. <h2 class="name">Uranium</h2>
  93. <p class="weight">238.02891</p>
  94. </div>
  95. <div class="element lanthanoid metal inner-transition " data-symbol="Gd" data-category="lanthanoid">
  96. <p class="number">64</p>
  97. <h3 class="symbol">Gd</h3>
  98. <h2 class="name">Gadolinium</h2>
  99. <p class="weight">157.25</p>
  100. </div>
  101. <div class="element transition metal " data-symbol="Y" data-category="transition">
  102. <p class="number">39</p>
  103. <h3 class="symbol">Y</h3>
  104. <h2 class="name">Yttrium</h2>
  105. <p class="weight">88.90585</p>
  106. </div>
  107. <div class="element metalloid " data-symbol="B" data-category="metalloid">
  108. <p class="number">5</p>
  109. <h3 class="symbol">B</h3>
  110. <h2 class="name">Boron</h2>
  111. <p class="weight">10.811</p>
  112. </div>
  113. <div class="element transition metal " data-symbol="Fe" data-category="transition">
  114. <p class="number">26</p>
  115. <h3 class="symbol">Fe</h3>
  116. <h2 class="name">Iron</h2>
  117. <p class="weight">55.845</p>
  118. </div>
  119. <div class="element actinoid metal inner-transition " data-symbol="Am" data-category="actinoid">
  120. <p class="number">95</p>
  121. <h3 class="symbol">Am</h3>
  122. <h2 class="name">Americium</h2>
  123. <p class="weight">(243)</p>
  124. </div>
  125. <div class="element transition metal " data-symbol="Zn" data-category="transition">
  126. <p class="number">30</p>
  127. <h3 class="symbol">Zn</h3>
  128. <h2 class="name">Zinc</h2>
  129. <p class="weight">65.38</p>
  130. </div>
  131. <div class="element lanthanoid metal inner-transition " data-symbol="Pm" data-category="lanthanoid">
  132. <p class="number">61</p>
  133. <h3 class="symbol">Pm</h3>
  134. <h2 class="name">Promethium</h2>
  135. <p class="weight">(145)</p>
  136. </div>
  137. <div class="element post-transition metal " data-symbol="In" data-category="post-transition">
  138. <p class="number">49</p>
  139. <h3 class="symbol">In</h3>
  140. <h2 class="name">Indium</h2>
  141. <p class="weight">114.818</p>
  142. </div>
  143. <div class="element metalloid " data-symbol="As" data-category="metalloid">
  144. <p class="number">33</p>
  145. <h3 class="symbol">As</h3>
  146. <h2 class="name">Arsenic</h2>
  147. <p class="weight">74.9216</p>
  148. </div>
  149. <div class="element lanthanoid metal inner-transition " data-symbol="Er" data-category="lanthanoid">
  150. <p class="number">68</p>
  151. <h3 class="symbol">Er</h3>
  152. <h2 class="name">Erbium</h2>
  153. <p class="weight">167.259</p>
  154. </div>
  155. <div class="element other nonmetal " data-symbol="Se" data-category="other">
  156. <p class="number">34</p>
  157. <h3 class="symbol">Se</h3>
  158. <h2 class="name">Selenium</h2>
  159. <p class="weight">78.96</p>
  160. </div>
  161. <div class="element alkaline-earth metal " data-symbol="Sr" data-category="alkaline-earth">
  162. <p class="number">38</p>
  163. <h3 class="symbol">Sr</h3>
  164. <h2 class="name">Strontium</h2>
  165. <p class="weight">87.62</p>
  166. </div>
  167. <div class="element transition metal " data-symbol="Zr" data-category="transition">
  168. <p class="number">40</p>
  169. <h3 class="symbol">Zr</h3>
  170. <h2 class="name">Zirconium</h2>
  171. <p class="weight">91.224</p>
  172. </div>
  173. <div class="element halogen nonmetal " data-symbol="At" data-category="halogen">
  174. <p class="number">85</p>
  175. <h3 class="symbol">At</h3>
  176. <h2 class="name">Astatine</h2>
  177. <p class="weight">(210)</p>
  178. </div>
  179. <div class="element transition metal " data-symbol="Nb" data-category="transition">
  180. <p class="number">41</p>
  181. <h3 class="symbol">Nb</h3>
  182. <h2 class="name">Niobium</h2>
  183. <p class="weight">92.90638</p>
  184. </div>
  185. <div class="element other nonmetal " data-symbol="O" data-category="other">
  186. <p class="number">8</p>
  187. <h3 class="symbol">O</h3>
  188. <h2 class="name">Oxygen</h2>
  189. <p class="weight">15.9994</p>
  190. </div>
  191. <div class="element actinoid metal inner-transition " data-symbol="Bk" data-category="actinoid">
  192. <p class="number">97</p>
  193. <h3 class="symbol">Bk</h3>
  194. <h2 class="name">Berkelium</h2>
  195. <p class="weight">(247)</p>
  196. </div>
  197. <div class="element halogen nonmetal " data-symbol="F" data-category="halogen">
  198. <p class="number">9</p>
  199. <h3 class="symbol">F</h3>
  200. <h2 class="name">Fluorine</h2>
  201. <p class="weight">18.9984032</p>
  202. </div>
  203. <div class="element actinoid metal inner-transition " data-symbol="Cf" data-category="actinoid">
  204. <p class="number">98</p>
  205. <h3 class="symbol">Cf</h3>
  206. <h2 class="name">Californium</h2>
  207. <p class="weight">(251)</p>
  208. </div>
  209. <div class="element noble-gas nonmetal " data-symbol="Ne" data-category="noble-gas">
  210. <p class="number">10</p>
  211. <h3 class="symbol">Ne</h3>
  212. <h2 class="name">Neon</h2>
  213. <p class="weight">20.1797</p>
  214. </div>
  215. <div class="element other nonmetal " data-symbol="P" data-category="other">
  216. <p class="number">15</p>
  217. <h3 class="symbol">P</h3>
  218. <h2 class="name">Phosphorus</h2>
  219. <p class="weight">30.973762</p>
  220. </div>
  221. <div class="element actinoid metal inner-transition " data-symbol="Fm" data-category="actinoid">
  222. <p class="number">100</p>
  223. <h3 class="symbol">Fm</h3>
  224. <h2 class="name">Fermium</h2>
  225. <p class="weight">(257)</p>
  226. </div>
  227. <div class="element other nonmetal " data-symbol="S" data-category="other">
  228. <p class="number">16</p>
  229. <h3 class="symbol">S</h3>
  230. <h2 class="name">Sulfur</h2>
  231. <p class="weight">32.065</p>
  232. </div>
  233. <div class="element alkaline-earth metal " data-symbol="Ca" data-category="alkaline-earth">
  234. <p class="number">20</p>
  235. <h3 class="symbol">Ca</h3>
  236. <h2 class="name">Calcium</h2>
  237. <p class="weight">40.078</p>
  238. </div>
  239. <div class="element other nonmetal " data-symbol="C" data-category="other">
  240. <p class="number">6</p>
  241. <h3 class="symbol">C</h3>
  242. <h2 class="name">Carbon</h2>
  243. <p class="weight">12.0107</p>
  244. </div>
  245. <div class="element alkali metal " data-symbol="Rb" data-category="alkali">
  246. <p class="number">37</p>
  247. <h3 class="symbol">Rb</h3>
  248. <h2 class="name">Rubidium</h2>
  249. <p class="weight">85.4678</p>
  250. </div>
  251. <div class="element post-transition metal " data-symbol="Uup" data-category="post-transition">
  252. <p class="number">115</p>
  253. <h3 class="symbol">Uup</h3>
  254. <h2 class="name">Ununpentium</h2>
  255. <p class="weight">(288)</p>
  256. </div>
  257. <div class="element transition metal " data-symbol="Sc" data-category="transition">
  258. <p class="number">21</p>
  259. <h3 class="symbol">Sc</h3>
  260. <h2 class="name">Scandium</h2>
  261. <p class="weight">44.955912</p>
  262. </div>
  263. <div class="element feature alkali width2 height2">
  264. <p class="number">1</p>
  265. <h3 class="symbol">Iso</h3>
  266. <h2 class="name">An exquisite jQuery plugin for magical&nbsp;layouts</h2>
  267. </div>
  268. <div class="element feature actinoid width2 height2">
  269. <p class="number">31</p>
  270. <h3 class="symbol">Dyn</h3>
  271. <h2 class="name">Dynamic, intelligent layouts</h2>
  272. </div>
  273. <div class="element feature lanthanoid width2 height2">
  274. <p class="number">27</p>
  275. <h3 class="symbol">Srt</h3>
  276. <h2 class="name">Re&ndash;order items with&nbsp;sorting</h2>
  277. </div>
  278. <div class="element feature metalloid width2 height2">
  279. <p class="number">61</p>
  280. <h3 class="symbol">Pow</h3>
  281. <h2 class="name">Powerful methods, simple&nbsp;syntax</h2>
  282. </div>
  283. <div class="element feature alkaline-earth width2 height2">
  284. <p class="number">11</p>
  285. <h3 class="symbol">Flt</h3>
  286. <h2 class="name">Reveal &amp; hide items with&nbsp;filtering</h2>
  287. </div>
  288. <div class="element feature transition width2 height2">
  289. <p class="number">41</p>
  290. <h3 class="symbol">Ani</h3>
  291. <h2 class="name">Captivating animations</h2>
  292. </div>
  293. <div class="element feature halogen width2 height2">
  294. <p class="number">71</p>
  295. <h3 class="symbol">Pro</h3>
  296. <h2 class="name">Progressively enhanced for CSS3 transforms &amp;&nbsp;transitions</h2>
  297. </div>
  298. <div class="element feature post-transition width2 height2">
  299. <p class="number">51</p>
  300. <h3 class="symbol">Any</h3>
  301. <h2 class="name">Sort items by just about&nbsp;anything</h2>
  302. </div>
  303. <div class="link" data-number="5"><a href="jquery.isotope.min.js">Down&#8203;load jquery&#8203;.isotope&#8203;.min.js</a></div>
  304. <div class="link" data-number="13"><a href="http://meta.metafizzy.co/files/isotope-site.zip">Down&#8203;load this project</a></div>
  305. <div class="link away" data-number="35"><a href="http://github.com/desandro/isotope">Isotope on GitHub</a></div>
  306. </div>
  307. <div id="sites"></div>
  308. <script src="js/jquery-1.6.4.min.js"></script>
  309. <script src="jquery.isotope.min.js"></script>
  310. <script>
  311. $(function(){
  312. var $container = $('#container');
  313. $container.isotope({
  314. masonry: {
  315. columnWidth: 120
  316. },
  317. sortBy: 'number',
  318. getSortData: {
  319. number: function( $elem ) {
  320. var number = $elem.hasClass('element') ?
  321. $elem.find('.number').text() :
  322. $elem.attr('data-number');
  323. return parseInt( number, 10 );
  324. },
  325. alphabetical: function( $elem ) {
  326. var name = $elem.find('.name'),
  327. itemText = name.length ? name : $elem;
  328. return itemText.text();
  329. }
  330. }
  331. });
  332. var $optionSets = $('#options .option-set'),
  333. $optionLinks = $optionSets.find('a');
  334. $optionLinks.click(function(){
  335. var $this = $(this);
  336. // don't proceed if already selected
  337. if ( $this.hasClass('selected') ) {
  338. return false;
  339. }
  340. var $optionSet = $this.parents('.option-set');
  341. $optionSet.find('.selected').removeClass('selected');
  342. $this.addClass('selected');
  343. // make option object dynamically, i.e. { filter: '.my-filter-class' }
  344. var options = {},
  345. key = $optionSet.attr('data-option-key'),
  346. value = $this.attr('data-option-value');
  347. // parse 'false' as false boolean
  348. value = value === 'false' ? false : value;
  349. options[ key ] = value;
  350. if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
  351. // changes in layout modes need extra logic
  352. changeLayoutMode( $this, options )
  353. } else {
  354. // otherwise, apply new options
  355. $container.isotope( options );
  356. }
  357. return false;
  358. });
  359. // Sites using Isotope markup
  360. var $sites = $('#sites'),
  361. $sitesTitle = $('<h2 class="loading"><img src="http://i.imgur.com/qkKy8.gif" />Loading sites using Isotope</h2>'),
  362. $sitesList = $('<ul class="clearfix"></ul>');
  363. $sites.append( $sitesTitle ).append( $sitesList );
  364. $sitesList.isotope({
  365. layoutMode: 'cellsByRow',
  366. cellsByRow: {
  367. columnWidth: 290,
  368. rowHeight: 400
  369. }
  370. });
  371. var ajaxError = function(){
  372. $sitesTitle.removeClass('loading').addClass('error')
  373. .text('Could not load sites using Isotope :(');
  374. };
  375. // dynamically load sites using Isotope from Zootool
  376. $.getJSON('http://zootool.com/api/users/items/?username=desandro' +
  377. '&apikey=8b604e5d4841c2cd976241dd90d319d7' +
  378. '&tag=bestofisotope&callback=?')
  379. .error( ajaxError )
  380. .success(function( data ){
  381. // proceed only if we have data
  382. if ( !data || !data.length ) {
  383. ajaxError();
  384. return;
  385. }
  386. var items = [],
  387. item, datum;
  388. for ( var i=0, len = data.length; i < len; i++ ) {
  389. datum = data[i];
  390. item = '<li><a href="' + datum.url + '">'
  391. + '<img src="' + datum.image.replace('/l.', '/m.') + '" />'
  392. + '<b>' + datum.title + '</b>'
  393. + '</a></li>';
  394. items.push( item );
  395. }
  396. var $items = $( items.join('') )
  397. .addClass('example');
  398. // set random number for each item
  399. $items.each(function(){
  400. $(this).attr('data-number', ~~( Math.random() * 100 + 15 ));
  401. });
  402. $items.imagesLoaded(function(){
  403. $sitesTitle.removeClass('loading').text('Sites using Isotope');
  404. $container.append( $items );
  405. $items.each(function(){
  406. var $this = $(this),
  407. itemHeight = Math.ceil( $this.height() / 120 ) * 120 - 10;
  408. $this.height( itemHeight );
  409. });
  410. $container.isotope( 'insert', $items );
  411. });
  412. });
  413. });
  414. </script>
  415. <footer>
  416. Isotope by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
  417. </footer>
  418. </section> <!-- #content -->
  419. </body>
  420. </html>