index.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width" />
  6. <title>Flickity tests</title>
  7. <link rel="stylesheet" href="../bower_components/qunit/qunit/qunit.css" media="screen" />
  8. <link rel="stylesheet" href="test.css" media="screen" />
  9. <link rel="stylesheet" href="../css/flickity.css" media="screen" />
  10. <script src="../bower_components/qunit/qunit/qunit.js"></script>
  11. <!-- dependencies -->
  12. <script src="../bower_components/get-size/get-size.js"></script>
  13. <!-- <script src="../bower_components/imagesloaded/imagesloaded.js"></script> -->
  14. <script src="../bower_components/desandro-matches-selector/matches-selector.js"></script>
  15. <script src="../bower_components/ev-emitter/ev-emitter.js"></script>
  16. <script src="../bower_components/fizzy-ui-utils/utils.js"></script>
  17. <script src="../bower_components/unipointer/unipointer.js"></script>
  18. <script src="../bower_components/unidragger/unidragger.js"></script>
  19. <!-- Flickity source -->
  20. <script src="../js/cell.js"></script>
  21. <script src="../js/slide.js"></script>
  22. <script src="../js/animate.js"></script>
  23. <script src="../js/flickity.js"></script>
  24. <script src="../js/drag.js"></script>
  25. <script src="../js/prev-next-button.js"></script>
  26. <script src="../js/page-dots.js"></script>
  27. <script src="../js/player.js"></script>
  28. <script src="../js/add-remove-cell.js"></script>
  29. <script src="../js/lazyload.js"></script>
  30. <!-- turn off accessibility for these tests
  31. was causing bugs with dragging tests -->
  32. <script>
  33. Flickity.defaults.accessibility = false;
  34. </script>
  35. <!-- unit tests -->
  36. <script src="unit/init.js"></script>
  37. <script src="unit/cell-selector.js"></script>
  38. <script src="unit/empty.js"></script>
  39. <script src="unit/get-parent-cell.js"></script>
  40. <script src="unit/position-cells.js"></script>
  41. <script src="unit/contain.js"></script>
  42. <!-- drag tests are buggy. moved to drag.html -->
  43. <!-- <script src="unit/drag.js"></script> -->
  44. <script src="unit/auto-play.js"></script>
  45. <script src="unit/prev-next-buttons.js"></script>
  46. <script src="unit/page-dots.js"></script>
  47. <script src="unit/get-wrap-cells.js"></script>
  48. <script src="unit/watch.js"></script>
  49. <script src="unit/resize.js"></script>
  50. <script src="unit/add-remove-cells.js"></script>
  51. <script src="unit/destroy.js"></script>
  52. <script src="unit/lazyload.js"></script>
  53. <script src="unit/lazyload-srcset.js"></script>
  54. <script src="unit/group-cells.js"></script>
  55. <script src="unit/adaptive-height.js"></script>
  56. <script src="unit/select-cell.js"></script>
  57. <script src="unit/change.js"></script>
  58. <script src="unit/initial-index.js"></script>
  59. </head>
  60. <body>
  61. <div id="qunit"></div>
  62. <h2>Init</h2>
  63. <div id="init" class="gallery">
  64. <div class="cell">1</div>
  65. <div class="cell">2</div>
  66. <div class="cell">3</div>
  67. <div class="cell">4</div>
  68. <div class="cell">5</div>
  69. <div class="cell">6</div>
  70. </div>
  71. <h2>cellSelector</h2>
  72. <div id="cell-selector" class="gallery">
  73. <p class="not-cell not-cell1">not cell 1</p>
  74. <div class="cell">1</div>
  75. <div class="cell">2</div>
  76. <div class="cell">3</div>
  77. <div class="cell">4</div>
  78. <p class="not-cell not-cell2">not cell 2</p>
  79. <div class="cell">5</div>
  80. <div class="cell">6</div>
  81. </div>
  82. <h2>empty</h2>
  83. <div id="empty" class="gallery"></div>
  84. <h2>getParentCell</h2>
  85. <div id="get-parent-cell" class="gallery">
  86. <div class="cell cell1"><span class="child1">1</span></div>
  87. <div class="cell"><div><span class="child2">2</span></div></div>
  88. <div class="cell cell3">3</div>
  89. <div class="cell">4</div>
  90. <div class="cell">5</div>
  91. <div class="cell">6</div>
  92. </div>
  93. <div class="outside"></div>
  94. <h2>position cells</h2>
  95. <div id="position-cells" class="gallery variable-width">
  96. <div class="cell width2">1</div>
  97. <div class="cell">2</div>
  98. <div class="cell width3">3</div>
  99. <div class="cell width2">4</div>
  100. <div class="cell width3">5</div>
  101. <div class="cell">6</div>
  102. </div>
  103. <h2>contain</h2>
  104. <div id="contain" class="gallery variable-width">
  105. <div class="cell">1</div>
  106. <div class="cell">2</div>
  107. <div class="cell width3">3</div>
  108. <div class="cell width2">4</div>
  109. <div class="cell">5</div>
  110. <div class="cell">6</div>
  111. </div>
  112. <h2>auto-play</h2>
  113. <div id="auto-play" class="gallery">
  114. <div class="cell">1</div>
  115. <div class="cell">2</div>
  116. <div class="cell">3</div>
  117. </div>
  118. <h2>prev/next buttons</h2>
  119. <div id="prev-next-buttons" class="gallery">
  120. <div class="cell">1</div>
  121. <div class="cell">2</div>
  122. <div class="cell">3</div>
  123. <div class="cell">4</div>
  124. <div class="cell">5</div>
  125. <div class="cell">6</div>
  126. </div>
  127. <h2>page dots</h2>
  128. <div id="page-dots" class="gallery">
  129. <div class="cell">1</div>
  130. <div class="cell">2</div>
  131. <div class="cell">3</div>
  132. <div class="cell">4</div>
  133. <div class="cell">5</div>
  134. <div class="cell">6</div>
  135. </div>
  136. <h2>getWrapCells</h2>
  137. <div id="get-wrap-cells" class="gallery variable-width">
  138. <div class="cell">1</div>
  139. <div class="cell">2</div>
  140. <div class="cell">3</div>
  141. <div class="cell">4</div>
  142. <div class="cell">5</div>
  143. <div class="cell">6</div>
  144. </div>
  145. <h2>watch</h2>
  146. <div id="watch" class="gallery">
  147. <div class="cell">1</div>
  148. <div class="cell">2</div>
  149. <div class="cell">3</div>
  150. <div class="cell">4</div>
  151. <div class="cell">5</div>
  152. <div class="cell">6</div>
  153. </div>
  154. <h2>resize</h2>
  155. <div id="resize" class="gallery">
  156. <div class="cell">1</div>
  157. <div class="cell">2</div>
  158. <div class="cell">3</div>
  159. <div class="cell">4</div>
  160. <div class="cell">5</div>
  161. <div class="cell">6</div>
  162. </div>
  163. <h2>add/remove-cells</h2>
  164. <div id="add-remove-cells" class="gallery variable-width">
  165. <div class="cell">1</div>
  166. <div class="cell">2</div>
  167. <div class="cell">3</div>
  168. <div class="cell">4</div>
  169. <div class="cell">5</div>
  170. <div class="cell">6</div>
  171. </div>
  172. <h2>destroy</h2>
  173. <div id="destroy" class="gallery">
  174. <div class="cell">1</div>
  175. <div class="cell">2</div>
  176. <div class="cell">3</div>
  177. <div class="cell">4</div>
  178. <div class="cell">5</div>
  179. <div class="cell">6</div>
  180. </div>
  181. <h2>lazyload</h2>
  182. <div id="lazyload" class="gallery">
  183. <div class="cell"><img data-flickity-lazyload="http://i.imgur.com/r8p3Xgq.jpg" /></div>
  184. <img class="img-cell" data-flickity-lazyload="http://i.imgur.com/q9zO6tw.jpg" />
  185. <div class="cell"><img data-flickity-lazyload="http://i.imgur.com/bwy74ok.jpg" /></div>
  186. <div class="cell"><img data-flickity-lazyload="http://i.imgur.com/hODreXI.jpg" /></div>
  187. <div class="cell"><img data-flickity-lazyload="http://i.imgur.com/UORFJ3w.jpg" /></div>
  188. <div class="cell"><img data-flickity-lazyload="http://i.imgur.com/bAZWoqx.jpg" /></div>
  189. <div class="cell"><img data-flickity-lazyload="http://i.imgur.com/PgmEBSB.jpg" /></div>
  190. <img class="img-cell" data-flickity-lazyload="http://i.imgur.com/aboaFoB.jpg" />
  191. <div class="cell"><img data-flickity-lazyload="http://i.imgur.com/LkmcILl.jpg" /></div>
  192. </div>
  193. <h2>lazyload srcset</h2>
  194. <div id="lazyload-srcset" class="gallery">
  195. <div class="cell">
  196. <img data-flickity-lazyload-src="https://picsum.photos/360/270/?image=718"
  197. data-flickity-lazyload-srcset="
  198. https://picsum.photos/720/540/?image=718 720w,
  199. https://picsum.photos/360/270/?image=718 360w"
  200. sizes="(min-width: 1024px) 720px, 360px" />
  201. </div>
  202. <img class="img-cell"
  203. data-flickity-lazyload-srcset="
  204. https://picsum.photos/720/540/?image=517 720w,
  205. https://picsum.photos/360/270/?image=517 360w"
  206. sizes="(min-width: 1024px) 720px, 360px"
  207. />
  208. <div class="cell"></div>
  209. <div class="cell"></div>
  210. <div class="cell"></div>
  211. <div class="cell"></div>
  212. </div>
  213. <h2>groupCells</h2>
  214. <div id="group-cells" class="gallery">
  215. <div class="cell"></div>
  216. <div class="cell cell--width2"></div>
  217. <div class="cell"></div>
  218. <div class="cell cell--width3"></div>
  219. <div class="cell"></div>
  220. <div class="cell cell--width2"></div>
  221. <div class="cell cell--width2"></div>
  222. <div class="cell cell--width2"></div>
  223. <div class="cell cell--width4"></div>
  224. <div class="cell"></div>
  225. <div class="cell"></div>
  226. <div class="cell cell--width2"></div>
  227. <div class="cell"></div>
  228. <div class="cell"></div>
  229. </div>
  230. <h2>adaptiveHeight</h2>
  231. <div id="adaptive-height" class="gallery">
  232. <div class="cell cell--height2"></div>
  233. <div class="cell"></div>
  234. <div class="cell cell--height3"></div>
  235. <div class="cell"></div>
  236. <div class="cell cell--height4"></div>
  237. <div class="cell cell--height2"></div>
  238. <div class="cell"></div>
  239. <div class="cell cell--height2"></div>
  240. </div>
  241. <h2>selectCell</h2>
  242. <div id="select-cell" class="gallery">
  243. <div class="cell select-cell__0">0</div>
  244. <div class="cell select-cell__1">1</div>
  245. <div class="cell select-cell__2">2</div>
  246. <div class="cell select-cell__3">3</div>
  247. <div class="cell select-cell__4">4</div>
  248. <div class="cell select-cell__5">5</div>
  249. <div class="cell select-cell__6">6</div>
  250. <div class="cell select-cell__7">7</div>
  251. </div>
  252. <h2>change</h2>
  253. <div id="change" class="gallery">
  254. <div class="cell">0</div>
  255. <div class="cell">1</div>
  256. <div class="cell">2</div>
  257. <div class="cell">3</div>
  258. <div class="cell">4</div>
  259. </div>
  260. <h2>initialIndex</h2>
  261. <div id="initial-index" class="gallery variable-width">
  262. <div class="cell">0</div>
  263. <div class="cell">1</div>
  264. <div class="cell">2</div>
  265. <div class="cell">3</div>
  266. <div class="cell cell--initial">4</div>
  267. <div class="cell">5</div>
  268. <div class="cell">6</div>
  269. <div class="cell">7</div>
  270. <div class="cell">8</div>
  271. <div class="cell">9</div>
  272. </div>
  273. </body>
  274. </html>