wrap-around.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width" />
  6. <title>wrap around</title>
  7. <link rel="stylesheet" href="../css/flickity.css" />
  8. <link rel="stylesheet" href="sandbox.css" />
  9. <style>
  10. #no-margin .cell {
  11. width: 25%;
  12. margin: 0;
  13. }
  14. #tight-wrap {
  15. width: 200px;
  16. margin-left: auto;
  17. margin-right: auto;
  18. }
  19. #tight-wrap .cell {
  20. width: 50%;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <h1>wrap around</h1>
  26. <div id="gallery1" class="container variable-width">
  27. <div class="cell n1">1</div>
  28. <div class="cell n2 w2">2</div>
  29. <div class="cell n3 w3">3</div>
  30. <div class="cell n4">4</div>
  31. <div class="cell n5 w2">5</div>
  32. <div class="cell n6">6</div>
  33. </div>
  34. <div id="gallery2" class="container variable-width">
  35. <div class="cell n1">1</div>
  36. <div class="cell n2 w2">2</div>
  37. <div class="cell n3 w3">3</div>
  38. <div class="cell n4">4</div>
  39. <div class="cell n5 w2">5</div>
  40. <div class="cell n6 w3">6</div>
  41. </div>
  42. <h2>Left aligned</h2>
  43. <div id="gallery6" class="container variable-width">
  44. <div class="cell n1">1</div>
  45. <div class="cell n2 w2">2</div>
  46. <div class="cell n3 w3">3</div>
  47. <div class="cell n4">4</div>
  48. <div class="cell n5 w2">5</div>
  49. <div class="cell n6">6</div>
  50. </div>
  51. <h2>Fixed-width cells, pixel-positioning HTML init</h2>
  52. <div id="gallery7" class="container fixed-width js-flickity"
  53. data-flickity-options='{ "wrapAround": true, "percentPosition": false }'>
  54. <div class="cell n1">1</div>
  55. <div class="cell n2">2</div>
  56. <div class="cell n3">3</div>
  57. <div class="cell n4">4</div>
  58. <div class="cell n5">5</div>
  59. <div class="cell n6">6</div>
  60. <div class="cell n1">7</div>
  61. <div class="cell n2">8</div>
  62. </div>
  63. <h2>HTML init</h2>
  64. <div id="gallery3" class="container variable-width js-flickity"
  65. data-flickity-options='{ "wrapAround": true }'>
  66. <div class="cell n1">1</div>
  67. <div class="cell n2 w2">2</div>
  68. <div class="cell n3 w3">3</div>
  69. <div class="cell n4">4</div>
  70. <div class="cell n5 w2">5</div>
  71. <div class="cell n6">6</div>
  72. </div>
  73. <h2>freeScroll</h2>
  74. <div id="gallery4" class="container variable-width">
  75. <div class="cell n1">1</div>
  76. <div class="cell n2 w2">2</div>
  77. <div class="cell n3 w3">3</div>
  78. <div class="cell n4">4</div>
  79. <div class="cell n5 w2">5</div>
  80. <div class="cell n6">6</div>
  81. </div>
  82. <div id="gallery5" class="container variable-width">
  83. <div class="cell n1">1</div>
  84. <div class="cell n2 w2">2</div>
  85. <div class="cell n3 w3">3</div>
  86. <div class="cell n4">4</div>
  87. <div class="cell n5 w2">5</div>
  88. <div class="cell n6 w3">6</div>
  89. </div>
  90. <h2>no margin for error</h2>
  91. <div id="no-margin" class="container variable-width js-flickity"
  92. data-flickity-options='{ "wrapAround": true, "cellAlign": "right" }'>
  93. <div class="cell n1">1</div>
  94. <div class="cell n2">2</div>
  95. <div class="cell n3">3</div>
  96. <div class="cell n4">4</div>
  97. <div class="cell n5">5</div>
  98. </div>
  99. <h2>tight wrap #589</h2>
  100. <div id="tight-wrap" class="container" data-flickity='{ "wrapAround": true }'>
  101. <div class="cell n1">1</div>
  102. <div class="cell n2">2</div>
  103. <div class="cell n3">3</div>
  104. <div class="cell n4">4</div>
  105. </div>
  106. <script src="../bower_components/get-size/get-size.js"></script>
  107. <script src="../bower_components/desandro-matches-selector/matches-selector.js"></script>
  108. <script src="../bower_components/ev-emitter/ev-emitter.js"></script>
  109. <script src="../bower_components/unipointer/unipointer.js"></script>
  110. <script src="../bower_components/unidragger/unidragger.js"></script>
  111. <script src="../bower_components/fizzy-ui-utils/utils.js"></script>
  112. <script src="../js/cell.js"></script>
  113. <script src="../js/slide.js"></script>
  114. <script src="../js/animate.js"></script>
  115. <script src="../js/flickity.js"></script>
  116. <script src="../js/drag.js"></script>
  117. <script src="../js/prev-next-button.js"></script>
  118. <script src="../js/page-dots.js"></script>
  119. <script src="../js/player.js"></script>
  120. <script src="../js/add-remove-cell.js"></script>
  121. <script>
  122. window.onload = function() {
  123. var flky = window.flky = new Flickity( '#gallery1', {
  124. wrapAround: true
  125. });
  126. var flky2 = window.flky2 = new Flickity( '#gallery2', {
  127. });
  128. var flky6 = window.flky6 = new Flickity( '#gallery6', {
  129. wrapAround: true,
  130. cellAlign: 'left'
  131. });
  132. var flky4 = window.flky4 = new Flickity( '#gallery4', {
  133. wrapAround: true,
  134. freeScroll: true
  135. });
  136. var flky5 = window.flky5 = new Flickity( '#gallery5', {
  137. freeScroll: true
  138. });
  139. };
  140. </script>
  141. </body>
  142. </html>