Skip to content

frontpack/photoswipe-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhotoSwipe Handler

Default handler for PhotoSwipe.

Installation

Download a latest package or use Composer:

composer require frontpack/photoswipe-handler

Include PhotoSwipe and photoswipe-handler.js file to HTML page.

<link rel="stylesheet" href="/path/to/photoswipe/photoswipe.css">
<link rel="stylesheet" href="/path/to/photoswipe/default-skin/default-skin.css">

<script src="/path/to/photoswipe/photoswipe.min.js"></script>
<script src="/path/to/photoswipe/photoswipe-ui-default.min.js"></script>
<script src="/path/to/photoswipe-handler.js"></script>

Usage

Single photo

<a href="/path/to/original.jpg" class="photoswipe" data-size="<original size of image>">...</a>
<a href="/path/to/original.jpg" class="photoswipe" data-size="1024x768">...</a>

Gallery

<a href="/path/to/original.jpg" class="photoswipe" data-size="<original size of image>" data-gallery="<gallery-id>">...</a>
<a href="/path/to/original.jpg" class="photoswipe" data-size="1024x768" data-gallery="my-gallery">...</a>

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/