jquery.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jquery</title>
  6. <link rel="stylesheet" href="../css/flickity.css" />
  7. <link rel="stylesheet" href="sandbox.css" />
  8. </head>
  9. <body>
  10. <h1>jquery</h1>
  11. <div id="gallery1" class="container">
  12. <div class="cell" n1></div>
  13. <div class="cell" n2></div>
  14. <div class="cell" n3></div>
  15. <div class="cell" n4></div>
  16. <div class="cell" n5></div>
  17. <div class="cell" n6></div>
  18. <div class="cell" n7></div>
  19. </div>
  20. <div id="gallery2" class="container variable-width">
  21. <div class="cell n1">1</div>
  22. <div class="cell n2 w2">2</div>
  23. <div class="cell n3 w3">3</div>
  24. <div class="cell n4">4</div>
  25. <div class="cell n5 w2">5</div>
  26. <div class="cell n6">6</div>
  27. </div>
  28. <script src="../bower_components/get-size/get-size.js"></script>
  29. <script src="../bower_components/desandro-matches-selector/matches-selector.js"></script>
  30. <script src="../bower_components/ev-emitter/ev-emitter.js"></script>
  31. <script src="../bower_components/unipointer/unipointer.js"></script>
  32. <script src="../bower_components/unidragger/unidragger.js"></script>
  33. <script src="../bower_components/fizzy-ui-utils/utils.js"></script>
  34. <script src="../bower_components/jquery/dist/jquery.min.js"></script>
  35. <script src="../bower_components/jquery-bridget/jquery-bridget.js"></script>
  36. <script src="../js/cell.js"></script>
  37. <script src="../js/slide.js"></script>
  38. <script src="../js/animate.js"></script>
  39. <script src="../js/flickity.js"></script>
  40. <script src="../js/drag.js"></script>
  41. <script src="../js/prev-next-button.js"></script>
  42. <script src="../js/page-dots.js"></script>
  43. <script src="../js/player.js"></script>
  44. <script src="../js/add-remove-cell.js"></script>
  45. <script>
  46. $( function() {
  47. var $gallery1 = $('#gallery1').flickity();
  48. var flkty = $gallery1.data('flickity');
  49. // $gallery1.on( 'dragMove', function( event, pointer ) {
  50. // console.log( event.type, pointer.pageX, pointer.pageY );
  51. // });
  52. $gallery1.on( 'cellSelect.flickity', function( event ) {
  53. console.log('selected', event.type, 'ns:' + event.namespace, flkty.selectedIndex );
  54. });
  55. $gallery1.on( 'settle.flickity', function( event ) {
  56. console.log('settled', flkty.x, event.type );
  57. });
  58. $gallery1.on( 'staticClick.flickity', function( event ) {
  59. console.log('staticClick', event.type );
  60. });
  61. $('#gallery2').flickity({
  62. wrapAround: true
  63. });
  64. });
  65. </script>
  66. </body>
  67. </html>