Skip to content

Opening flipbooks from a lightbox

Flipbooks DesktopTutorial2 min read16 views

Tagged

You’ll end up with a link or button on your own site that opens the flipbook in an overlay, with the page it was clicked from still behind it.

You’ll need

  • The flipbook’s published URL: the folder the software exported, served over https.
  • Edit access to the page that will carry the link.

The lightbox belongs to the page around the flipbook, not to the flipbook: the exported folder is an ordinary web page at its own URL, so any library that can open an iframe will open it. Fancybox is the one the old walkthrough used, and it still works, opened from a link rather than a permanent frame.

The steps

The working recipe is kept in one place: Embedding a publication on your own site. It carries the jQuery Fancybox needs, the tested Fancybox 3 files, the link markup with data-type="iframe", and the CSS that sizes the overlay — checked against a published reader rather than copied forward. Use your flipbook’s URL where its example has one.

This page no longer repeats the code. The copy it carried pinned Fancybox 3.4.1 and sized the overlay with .fancybox-slide--iframe.fancybox-content, a selector that matches no element — Fancybox puts those two classes on different elements — so the overlay was never sized by it. Two copies of a recipe drift; one does not.

What a Desktop flipbook changes

  • The URL is the exported folder’s index.html on your server, or the cloud address if you uploaded the flipbook there — not a dashboard link.
  • Fullscreen keeps working inside the overlay: the library builds the iframe with allowfullscreen.

If it doesn’t work

  • The link opens a plain page. The anchor is missing data-fancybox or data-type="iframe": without the second attribute Fancybox does not treat the flipbook as an iframe.
  • The overlay is cramped. The sizing rule is missing, or written against a selector that matches nothing — see the rule in e-162.
  • Nothing opens. jQuery or the library’s script did not load; the browser console shows $ is not defined when jQuery is the one missing.