group-cells.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width" />
  6. <title>group cells</title>
  7. <link rel="stylesheet" href="../css/flickity.css" />
  8. <style>
  9. * { box-sizing: border-box; }
  10. html { overflow-y: scroll; }
  11. .carousel {
  12. border: 1px solid;
  13. margin-bottom: 40px;
  14. /* width: 1000px;*/
  15. }
  16. .carousel__cell {
  17. /* width: 25%;*/
  18. width: 32%;
  19. height: 200px;
  20. background: #BDF;
  21. margin-left: 1%;
  22. margin-right: 1%;
  23. font-size: 40px;
  24. }
  25. /*.carousel__cell--width2 { width: 40%; }
  26. .carousel__cell--width3 { width: 80%; }*/
  27. .carousel__cell--width2 { width: 66%; }
  28. .carousel__cell--width3 { width: 100%; }
  29. .carousel__cell.is-selected {
  30. background: #68F;
  31. }
  32. @media (min-width: 1000px) {
  33. /* fit four */
  34. .carousel__cell { width: 23.5%; }
  35. .carousel__cell--width2 { width: 49%; }
  36. .carousel__cell--width3 { width: 74.5%; }
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <h1>group cells</h1>
  42. <div class="carousel carousel1">
  43. <div class="carousel__cell carousel__cell--width2">0</div>
  44. <div class="carousel__cell">1</div>
  45. <div class="carousel__cell">2</div>
  46. <div class="carousel__cell carousel__cell--width2">3</div>
  47. <div class="carousel__cell carousel__cell--width2">4</div>
  48. <div class="carousel__cell">5</div>
  49. <div class="carousel__cell">6</div>
  50. <div class="carousel__cell">7</div>
  51. <div class="carousel__cell carousel__cell--width3">8</div>
  52. <div class="carousel__cell">9</div>
  53. <div class="carousel__cell">10</div>
  54. </div>
  55. <script src="../bower_components/get-size/get-size.js"></script>
  56. <script src="../bower_components/desandro-matches-selector/matches-selector.js"></script>
  57. <script src="../bower_components/ev-emitter/ev-emitter.js"></script>
  58. <script src="../bower_components/unipointer/unipointer.js"></script>
  59. <script src="../bower_components/unidragger/unidragger.js"></script>
  60. <script src="../bower_components/fizzy-ui-utils/utils.js"></script>
  61. <script src="../js/cell.js"></script>
  62. <script src="../js/slide.js"></script>
  63. <script src="../js/animate.js"></script>
  64. <script src="../js/flickity.js"></script>
  65. <script src="../js/drag.js"></script>
  66. <script src="../js/prev-next-button.js"></script>
  67. <script src="../js/page-dots.js"></script>
  68. <script src="../js/player.js"></script>
  69. <script src="../js/add-remove-cell.js"></script>
  70. <script src="../js/lazyload.js"></script>
  71. <script>
  72. var flkty = new Flickity( '.carousel1', {
  73. groupCells: true,
  74. wrapAround: true,
  75. // cellAlign: 'right'
  76. });
  77. </script>
  78. </body>
  79. </html>