Lightbox (JavaScript)

JavaScript library


title: "Lightbox (JavaScript)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["javascript-libraries"] description: "JavaScript library" topic_path: "technology/web" source: "https://en.wikipedia.org/wiki/Lightbox_(JavaScript)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary JavaScript library ::

::figure[src="https://upload.wikimedia.org/wikipedia/commons/6/69/Lightbox_mockup.jpg" caption="A typical lightbox image display"] ::

Lightbox is a JavaScript library that displays images and videos by filling the screen, and dimming out the rest of the web page.

The original JavaScript library was written by Lokesh Dhakar. The term Lightbox may also refer to other similar JavaScript libraries. The technique gained widespread popularity due to its simple and elegant style.

The original Lightbox library used two JavaScript libraries, Prototype Javascript Framework and script.aculo.us, for its animations and positioning. In April 2012, the plugin was rewritten for jQuery. The open-source nature of Lightbox encouraged developers to modify and fork the code, resulting in plugins such as Colorbox, Magnific Popup, Slimbox or Thickbox.

Lightbox scripts are dependent upon a browser's JavaScript support. Browsers that do not load the script for whatever reason can instead simply load the image as a separate page load, losing the Lightbox effect but still retaining the ability to display the image.

References

References

  1. Jakob Nielsen, Alertbox. "10 Best Application UIs".
  2. Dhakar, Lokesh. "Lightbox JS".
  3. Herrington, Jack D. "Ajax and XML: Ajax for lightboxes". IBM DeveloperWorks.
  4. Schmitt, Christopher. (2006). "CSS Cookbook". [[O'Reilly Media.
  5. Dhakar, Lokesh. "Lightbox2".
  6. Schmitt, Christopher. (2006). "CSS Cookbook". [[O'Reilly Media.
  7. Zervaas, Quentin. (2007). "Practical Web 2.0 Applications with PHP". Springer.

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

javascript-libraries