dialog-lightboxv0.3.1

Deep links and the back button

Opening a slide adds #dlb=<id> to the URL, so the back button closes the box instead of leaving the page, and a link to that hash opens the slide, from anywhere on the page or from another site.

data-dlb-id gives a slide an id that stays when the order changes.

live · Deep links and the back button
Soft bands of violet, yellow, mint and purple Amber stripes across dark red

Straight to the amber stripes, or to the soft bands.

example.html
<div id="linked" class="row">
  <a href="/media/photo-7-1600.jpg" data-dlb-id="soft" data-dlb-width="1600" data-dlb-height="1066"><img src="/media/photo-7-480.jpg" alt="Soft bands of violet, yellow, mint and purple" /></a>
  <a href="/media/photo-4-1600.jpg" data-dlb-id="amber" data-dlb-width="1066" data-dlb-height="1600"><img src="/media/photo-4-480.jpg" alt="Amber stripes across dark red" /></a>
</div>
<p>Straight to <a href="#dlb=amber">the amber stripes</a>, or to <a href="#dlb=soft">the soft bands</a>.</p>
/