Spyro
Spyro

Reputation: 1

How to add lightbox in a single html file?

I tried lightbox out and everything works fine with it on my home pc. But now, I wonder if it's possible to add lightbox in a single html file. I used three different folders for it (css, js, html).

But now I want to add it only in the html file. For css I can put the code in For js I can add it in normaly, but this doesn't work for me.

The js code is from the lightbox site:

"(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory); .......... etc"

I want to run it online and have only space for an one pager (so I can't add separate folders like css and js, that's why I have to put everthing in one html folder).

Upvotes: 0

Views: 163

Answers (1)

Frish
Frish

Reputation: 1421

Add it in a <script> tag:

<script>
  /* lightbox code from file here */
</script>

Depending on the lightbox execution you may want to put it in the document <head> or just above the close </body> tag.

Upvotes: 1

Related Questions