Using a javascript lightbox function for images in Xaringan

Hi,

I use this lightbox function successfully in a Distill web page: Feature request: Lightbox for gutter plots and images · Issue #105 · rstudio/distill · GitHub

You can see it in action here: thoracicimaging.info by clicking on an image.

I would like to use it in a Xaringan presentation like this: Noon Case Conference

I've tried this YAML method (two excerpts below):

output:
  xaringan::moon_reader:
    css: 
        - myextra.css
        - xaringan-themer.css
        - hygge
        - width.css
        - lightbox.css

And

 navigation:
      scroll: false
 includes:
      in_header: "lightbox.html"

In lightbox.html, I put the content of the js file between <script> and </script> tags, and put the lightbox.css file in the root of the presentation folder.

The lightbox function does not work.

Any ideas for troubleshooting this for Xaringan ?

Thanks!

Howard