jhvanderschee / jhvanderschee/jekyllcodex

jquery-free lightbox is missing lightbox element

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
32
Forks
21
PR merge metrics
No merged PRs in 30d

Description

I tried your [lightbox](https://jekyllcodex.org/without-plugin/lightbox/) (which worked well), but then read your [Ditching jQuery and Twitter Bootstrap](https://jekyllcodex.org/blog/ditching-jquery-and-twitter-bootstrap/) post and tried that lightbox. It wasn't a drop in replacement because it's not adding the lightbox div:

```patch
diff --git a/assets/lightbox.js b/assets/lightbox.js
index 7f0675d..adbea3e 100644
--- a/assets/lightbox.js
+++ b/assets/lightbox.js
@@ -80,6 +80,12 @@ function setGallery(el) {
}

document.addEventListener("DOMContentLoaded", function() {
+
+ //create lightbox div in the footer
+ var newdiv = document.createElement("div");
+ newdiv.setAttribute('id',"lightbox");
+ document.body.appendChild(newdiv);
+
//add classes to links to be able to initiate lightboxes
var elements = document.querySelectorAll('a');
elements.forEach(element => {
```

Also, maybe you should link to that lighter lightbox from the lightbox page?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.