Get started with photoswipe CDN

MIT licensed

Photoswipe is a lightweight, free, and open-source JS image gallery library.

Tags:
  • image
  • gallery
  • lightbox
  • photo
  • touch
  • swipe
  • zoom

Stable version

Copied!

How to start using photoswipe CDN


<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://cdn.cdnhub.io/photoswipe/5.4.2/photoswipe.min.css">
  <link rel="stylesheet" href="https://cdn.cdnhub.io/photoswipe/5.4.2/default-skin/default-skin.min.css">
  <title>Get started with photoswipe CDN - cdnhub.io</title>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe-ui-default.min.js"></script>
</head>
<body>
  <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="pswp__bg"></div>
    <div class="pswp__scroll-wrap">
      <div class="pswp__container">
        <div class="pswp__item"></div>
      </div>
    </div>
    <div class="pswp__ui pswp__ui--hidden">
      <div class="pswp__topbar">
        <div class="pswp__counter"></div>
        <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
        <button class="pswp__button pswp__button--share" title="Share"></button>
        <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
        <button class="pswp__button pswp__button--zoom" title="Zoom in" aria-label="Zoom in" tabindex="0"></button>
      </div>
      <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
        <div class="pswp__share-tooltip"></div>
      </div>
      <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>
      <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>
      <div class="pswp__caption">
        <div class="pswp__caption__center"></div>
      </div>
    </div>
  </div>
  <div class="gallery">
    <button class="gallery__button" data-pswp-item="images/image1.jpg">Open image 1</button>
    <button class="gallery__button" data-pswp-item="images/image2.jpg">Open image 2</button>
  </div>
  <script src="script.js"></script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions