element-sizing.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>element sizing</title>
  6. <link rel="stylesheet" href="sandbox.css" />
  7. <style>
  8. /* #container { width: 501px; }*/
  9. .item, .grid-sizer { width: 20%; }
  10. .item.w2 { width: 40%; }
  11. .item.w3 { width: 60%; }
  12. </style>
  13. </head>
  14. <body>
  15. <h1>element sizing</h1>
  16. <div id="container" class="container">
  17. <div class="grid-sizer"></div>
  18. <div class="item"></div>
  19. <div class="item h4"></div>
  20. <div class="item w2 h2"></div>
  21. <div class="item w2"></div>
  22. <div class="item h3"></div>
  23. <div class="item w3"></div>
  24. <div class="item"></div>
  25. <div class="item h4"></div>
  26. <div class="item"></div>
  27. <div class="item w2 h4"></div>
  28. <div class="item w2"></div>
  29. <div class="item h5"></div>
  30. <div class="item w3"></div>
  31. <div class="item"></div>
  32. <div class="item h4"></div>
  33. <div class="item"></div>
  34. <div class="item w2 h5"></div>
  35. <div class="item w2"></div>
  36. <div class="item h3"></div>
  37. <div class="item w3"></div>
  38. <div class="item"></div>
  39. </div>
  40. <script src="../bower_components/eventEmitter/EventEmitter.js"></script>
  41. <script src="../bower_components/eventie/eventie.js"></script>
  42. <script src="../bower_components/doc-ready/doc-ready.js"></script>
  43. <script src="../bower_components/get-style-property/get-style-property.js"></script>
  44. <script src="../bower_components/get-size/get-size.js"></script>
  45. <script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
  46. <script src="../bower_components/matches-selector/matches-selector.js"></script>
  47. <script src="../bower_components/fizzy-ui-utils/utils.js"></script>
  48. <script src="../bower_components/outlayer/item.js"></script>
  49. <script src="../bower_components/outlayer/outlayer.js"></script>
  50. <script src="../masonry.js"></script>
  51. <script>
  52. docReady( function() {
  53. var container = document.querySelector('#container');
  54. var msnry = new Masonry( container, {
  55. columnWidth: '.grid-sizer',
  56. percentPosition: true
  57. });
  58. });
  59. </script>
  60. </body>
  61. </html>