Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. $(document).ready(function(){
  2. var pswpElement = $('.pswp')[0];
  3.  
  4. var items = [
  5. {
  6. src: 'my-file-1.jpg',
  7. w: 2240,
  8. h: 3968
  9. },
  10. {
  11. src: 'my-file-2.jpg',
  12. w: 960,
  13. h: 720
  14. },
  15. ];
  16.  
  17. var options = {
  18. maxSpreadZoom: 1.5,
  19. getDoubleTapZoom: function(isMouseClick, item){return item.initialZoomLevel < 0.7 ? 1 : 1.5;},
  20. index: 0,
  21. pinchToClose: false,
  22. closeOnScroll: false,
  23. closeOnVerticalDrag: false,
  24. escKey: false,
  25. history: false,
  26.  
  27. };
  28.  
  29. var gallery = new PhotoSwipe(pswpElement, false, items, options);
  30.  
  31. gallery.init();
  32. });
  33.  
  34. <!DOCTYPE html>
  35. <html>
  36. <head>
  37. <meta charset="utf-8">
  38. <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
  39. <link rel="stylesheet" href="index.css">
  40. <link rel="stylesheet" href="photoswipe.css">
  41. <link rel="stylesheet" href="default-skin/default-skin.css">
  42. <script src="jquery-3.4.0.min.js"></script>
  43. <script src="index.js"></script>
  44. <script src="photoswipe.min.js"></script>
  45. <script src="photoswipe-ui-default.min.js"></script>
  46. </head>
  47.  
  48. <body>
  49.  
  50. <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
  51. <div class="pswp__bg"></div>
  52. <div class="pswp__scroll-wrap">
  53. <div class="pswp__container">
  54. <div class="pswp__item"></div>
  55. <div class="pswp__item"></div>
  56. <div class="pswp__item"></div>
  57. </div>
  58. </div>
  59. </div>
  60.  
  61.  
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement