How to use the photoswipe/dist/photoswipe.js function in photoswipe

To help you get started, we’ve selected a few photoswipe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github moulapp / moul / assets / ps.js View on Github external
}
		} else {
			options.index = parseInt(index, 10)
		}

		// exit if index not found
		if (isNaN(options.index)) {
			return
		}

		if (disableAnimation) {
			options.showAnimationDuration = 0
		}

		// Pass data to PhotoSwipe and initialize it
		gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options)
		gallery.init()
		// gallery.bg.style.backgroundColor = gallery.currItem.bgColor

		// gallery.listen('beforeChange', () => {
		//   gallery.bg.style.backgroundColor = gallery.currItem.bgColor
		// })
	}

photoswipe

JavaScript gallery

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis