How can i use Lightbox with revealjs such that the slides do not change along the Lightbox? #14830
DescriptionHi, I want to build a presentation which has a slide with Lightbox figures. How can i use Lightbox with revealjs such that the slides do not change along the Lightbox? ---
title: "My presentation"
format: revealjs
lightbox: true
---
# first slide
with 1st text
# slide with images
::: {layout-ncol=3}
{group="my-gallery"}
{group="my-gallery"}
{group="my-gallery"}
:::
# second slide
2nd text
# final slide
final text |
Replies: 2 comments 2 replies
|
You are not doing anything wrong — nothing in Quarto's lightbox filter is reveal-aware. It builds a plain GLightbox instance and only hooks The instance is exposed as a global, though, so you can suspend reveal's keyboard handling while the lightbox is up: <script>
document.addEventListener('DOMContentLoaded', () => {
lightboxQuarto.on('open', () => Reveal.configure({ keyboard: false }));
lightboxQuarto.on('close', () => Reveal.configure({ keyboard: true }));
});
</script>Pull that in with If you also navigate the lightbox by clicking rather than by key, the same pair is the place to disable whatever else you need — reveal's |
|
Thanks for the workaround, and confirmed as a real gap on our side. The lightbox filter builds a plain GLightbox instance with no reveal.js awareness at all, so both keyboard handlers stay active at the same time: quarto-cli/src/resources/filters/layout/lightbox.lua Lines 383 to 416 in 1f609f0 We could hook I'll convert this to an issue to track it. |
You are not doing anything wrong — nothing in Quarto's lightbox filter is reveal-aware. It builds a plain GLightbox instance and only hooks
slide_before_load/slide_after_loadfor its own captions, so when the lightbox is open both it and reveal.js are still listening for arrow keys, and one keypress moves both.The instance is exposed as a global, though, so you can suspend reveal's keyboard handling while the lightbox is up:
Pull that in with
include-afte…