@vovayatsyuk/photoswipe-object-position

1.0.0 • Public • Published

ObjectPosition plugin for PhotoSwipe

ObjectPosition — is a PhotoSwipe plugin that improves object-position property handling when cropped thumbnails are used.

Improvements

  1. Fixes thumbnail jumping animation while opening/closing lightbox.
  2. Make sure that the initially zoomed image will show the same region of the image as we saw in cropped thumbnail.

Usage

import PhotoSwipeLightbox from '/assets/photoswipe/dist/photoswipe-lightbox.esm.js';
import ObjectPosition from '/assets/photoswipe-object-position.js';

const lightbox = new PhotoSwipeLightbox({
  gallery: '#my-gallery',
  children: 'a',
  pswpModule: () => import('/assets/photoswipe/dist/photoswipe.esm.js')
});

new ObjectPosition(lightbox);

lightbox.init();

Readme

Keywords

Package Sidebar

Install

npm i @vovayatsyuk/photoswipe-object-position

Weekly Downloads

364

Version

1.0.0

License

MIT

Unpacked Size

5.1 kB

Total Files

4

Last publish

Collaborators

  • vovayatsyuk