dialog-lightboxv0.3.1

Examples

One feature per example, each running live with only the code it needs.

Every example on these pages runs on the page, and below it are exactly the files that run: example.html, and where needed style.css and script.js. The scripts import dialog-lightbox as you would after npm install.

The dialog

All examples share one dialog. Only the viewport is required; the library finds the other parts by their attributes and disables buttons that can’t act.

example.html
<dialog class="box" aria-label="Photo viewer">
  <div data-dlb-viewport></div>
  <div class="box-bar">
    <span class="box-count"><span data-dlb-counter></span> / <span data-dlb-total></span></span>
    <button type="button" data-dlb-zoom>Zoom</button>
    <button type="button" data-dlb-close>Close</button>
  </div>
  <button class="box-side" type="button" data-dlb-prev aria-label="Previous">←</button>
  <button class="box-side" type="button" data-dlb-next aria-label="Next">→</button>
  <p class="box-caption"></p>
  <template data-dlb-overlay="video">
    <div class="box-video">
      <button type="button" data-dlb-play aria-label="Play"></button>
      <button type="button" data-dlb-mute aria-label="Sound off"></button>
      <button type="button" data-dlb-fullscreen>Fullscreen</button>
    </div>
    <span data-dlb-progress></span>
  </template>
</dialog>

In this section