dialog-lightboxv0.3.1

API and events

lightbox() returns an object to open, move and close the box from your own code, and to listen for its events.

This gallery also has loop: true, so after the last photo comes the first.

live · API and events
Diagonal bands of blue, orange, green and cream A thin blue line between pale blue and navy Dark teal over a thin orange stripe and orange

example.html
<div id="controlled" class="row">
  <a href="/media/photo-1-1600.jpg" data-dlb-width="1600" data-dlb-height="1066"><img src="/media/photo-1-480.jpg" alt="Diagonal bands of blue, orange, green and cream" /></a>
  <a href="/media/photo-3-1600.jpg" data-dlb-width="1600" data-dlb-height="1066"><img src="/media/photo-3-480.jpg" alt="A thin blue line between pale blue and navy" /></a>
  <a href="/media/photo-2-1600.jpg" data-dlb-width="1600" data-dlb-height="1066"><img src="/media/photo-2-480.jpg" alt="Dark teal over a thin orange stripe and orange" /></a>
</div>
<p><button type="button" class="open-last">Open the last photo</button></p>
<pre class="log" aria-live="polite"></pre>
/