Zoom
A click, a double tap or the zoom button zooms a photo to its native width, at most three times the size it fits at.
The native width comes from data-dlb-width, or from the large image once it has loaded. Drag to pan.
live · Zoom
<div id="large" class="row">
<a href="/media/photo-6-3200.jpg" data-dlb-width="3200" data-dlb-height="800">
<img src="/media/photo-6-720.jpg" alt="Purple, a band of orange, and pale lilac" />
</a>
<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>
</div>/* A row of thumbnails, 7rem high */
.row {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.row img {
display: block;
width: auto;
height: 7rem;
}import { lightbox } from "dialog-lightbox";
lightbox({ gallery: document.querySelector("#large"), dialog: document.querySelector("dialog.box") });
