Skip to content

4.0.0

Compare
Choose a tag to compare
@jonnitto jonnitto released this 24 Dec 15:56
· 19 commits to master since this release

💥 Breaking

Upgrade to PhotoSwipe 5 in #29

Required HTML markup

Each element that matches the selector a.lightbox must have such attributes:

  • Image URL in href or data-pswp-src attribute (latter has higher priority).
  • Image width in data-pswp-width.
  • Image height in data-pswp-height.

And optionally:

  • <img> thumbnail within the link element that will be displayed before the large image is loaded
  • Optional data-cropped="true" attribute if thumbnail is cropped. See also
    Animating from Cropped Thumbnail.
    PhotoSwipe API supports almost any markup and any data source, read more about it here.

Example:

<a
  class="lightbox"
  data-pswp-width="2560"
  data-pswp-height="1200"
  href="path/to/image.jpg"
  >...</a
>

Javascript variables

There is one global variable who get set during the intialisation:

neosPhotoSwipe This object stores the lightbox variable from PhotoSwiper. (The variable who get used to call
lightbox.init()). With this, you can add you own event listener or trigger
methods.

Full Changelog: 3.4.1...4.0.0