Lightbox2: the original jQuery image overlay, now in maintenance mode
THE original Lightbox script (v2).
At a glance
- What is it?
- Lightbox2 is the MIT-licensed jQuery plugin that turns linked images into an overlay gallery. It still works, the README points new projects at Lightbox3, and the build is a small npm pipeline.
- Who is it for?
- Adopt Lightbox2 when you already load jQuery and want a gallery overlay with no framework and no build step of your own. Do not adopt it for a new touch-first or dependency-free project: the README itself points to Lightbox3, and Lightbox2 is described as being in maintenance mode.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 171 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What Lightbox2 solves, and who still needs it
A page with a grid of thumbnails has a boring problem: clicking one should show the full image without navigating away or writing a modal from scratch. Lightbox2 handles that by overlaying images on top of the current page. The package description in package.json calls it "The original Lightbox script. Uses jQuery." That second sentence is the whole adoption decision. If jQuery is already on the page, Lightbox2 is a few lines of markup and one script tag. If it is not, you are adding a dependency to get an overlay. The audience is narrow but real: legacy sites, CMS themes, marketing pages and documentation sets that already ship jQuery and need a gallery that behaves the same in every modern browser. The README describes it as small and says it "works on all modern browsers." It is not a framework, not a component library, and not a build-time tool. It is one script and one stylesheet.
How the overlay, gallery grouping and slideshow actually work
Lightbox2 is a jQuery plugin at its core. The source lives in src/js/lightbox.js, and the build copies it to dist/js/lightbox.js, which package.json names as the package main entry. Images are grouped by a shared rel attribute in the markup, which is what makes a set of thumbnails behave as one gallery with next and previous controls. The build script also concatenates jQuery with the plugin into dist/js/lightbox-plus-jquery.js, so a page that does not already have jQuery can load one file instead of two. Styling is separate: src/css/lightbox.css is minified to dist/css/lightbox.min.css, and images used by the overlay ship under dist/images. The repository keeps examples/index.html as the working demo, and the README's local development section tells you to serve the project and open that file. There is no server component and no API. Data flow is entirely in the browser: the browser parses the page, the plugin binds to the links you marked up, and the overlay is drawn from the image URLs already in the DOM.
Installing Lightbox2 from npm and serving the dist files
The README documents a local development flow rather than an application install, so the commands below come from the package scripts and the repository layout. Install dependencies first. This pulls jQuery 3.7.1 plus the build tooling (eslint, uglify-js, clean-css-cli) as listed in package.json.
A first real gallery: markup, jQuery and the rel attribute
The example page in the repository is the reference for markup. A gallery is a set of anchors pointing at full-size images, each wrapping a thumbnail, all sharing a rel value. The plugin reads those anchors and takes over the click. Because the package depends on jQuery 3.7.1, the page needs jQuery loaded before the plugin, unless you use the concatenated dist/js/lightbox-plus-jquery.js build, which already contains it.
Maintenance mode, jQuery and the case for Lightbox3
The README opens with a pointer to Lightbox3 and states plainly that Lightbox2 is in maintenance mode. That is the most important sentence on the page for anyone starting today. The repository is not archived and the last push was on 2026-04-13, so work has not stopped, but the project's own documentation frames it as a maintained line rather than the place for new work. The second limitation is the jQuery dependency. package.json lists jquery ^3.7.1 as a runtime dependency, and the description says the script uses jQuery. On a modern page that has moved to native DOM APIs or a component framework, that is a real cost for what is essentially an overlay. The third is scope: Lightbox2 is an image overlay. It is the wrong tool for video players, complex carousels, or galleries that need lazy loading, responsive srcset negotiation or framework-level state. The README does not document a plugin API for extending the overlay, so if your requirement goes past images in a grouped overlay, you are outside what this project claims to do.
Lightbox2 compared with GLightbox
GLightbox is the alternative most often reached for when jQuery is not on the page. The difference is architectural rather than cosmetic: GLightbox is a standalone JavaScript library, while Lightbox2 is a jQuery plugin whose distributable is built by concatenating jQuery into dist/js/lightbox-plus-jquery.js precisely because the dependency is required. If your page already loads jQuery, that difference costs you nothing and Lightbox2's markup-first approach (anchors plus a shared rel) is about as simple as a gallery gets. If your page does not load jQuery, GLightbox avoids adding it. The comparison is not about which overlay looks better; it is about whether jQuery is already part of your page weight. Lightbox2 also ships a separate plus-jquery bundle for exactly that situation, which is the pragmatic middle ground if you want the original markup pattern without managing a second dependency yourself.
Licence, upgrade cost and what the repository does not cover
Lightbox2 is MIT licensed, stated in the README and in the LICENSE file, and package.json carries the same MIT entry. MIT is permissive: you can use it commercially, modify it and redistribute it, provided the copyright notice and permission notice are kept. The README does not walk through what that means for bundled builds, and this is not legal advice, so if you are redistributing a concatenated bundle that includes jQuery, check jQuery's own licence terms separately. Upgrade cost is low by design. The release history shows v2.11.4 in 2023, v2.11.5 in 2024 and v2.12.0 in 2026, so the cadence is slow and the surface is small: a script, a stylesheet and an images folder. There is no database, no configuration file and no migration path to worry about. What the README does not document is a rollback procedure, and DEPLOY.md is referenced for release instructions rather than upgrade guidance. If you vendor the dist files into your own repository, upgrading is replacing those files. If you load them from a CDN, upgrading is changing a URL, and the README's local development section is the only build documentation you get.
Editorial conclusion
Adopt Lightbox2 when you already load jQuery and want a gallery overlay with no framework and no build step of your own. Do not adopt it for a new touch-first or dependency-free project: the README itself points to Lightbox3, and Lightbox2 is described as being in maintenance mode. Before wiring it in, check that your page already loads jQuery 3.7.1 or that you are willing to use dist/js/lightbox-plus-jquery.js, and confirm which dist file your CDN serves.
Frequently asked questions
What is Lightbox2?
Lightbox2 is a small JavaScript library that overlays images on top of the current page, built as a jQuery plugin. The package description calls it "The original Lightbox script. Uses jQuery."
How do I install Lightbox2?
The README documents local development: run npm install, then npm run build to produce the dist files, and serve the repository to open /examples/index.html. The package depends on jQuery 3.7.1, and a concatenated bundle with jQuery is produced by the build.
What are the alternatives to Lightbox2?
GLightbox is the alternative to weigh when jQuery is not already on the page, since Lightbox2 is a jQuery plugin and GLightbox is standalone. The README also points to Lightbox3, which it describes as having zero dependencies and being built for touch.
Is Lightbox2 still maintained?
The README states that Lightbox2 is in maintenance mode and points readers to Lightbox3. The repository is not archived and the last push was on 2026-04-13, with v2.12.0 released on 2026-02-28.
What licence does Lightbox2 use?
Lightbox2 is licensed under the MIT License, stated in the README and in the LICENSE file, and package.json lists the same MIT entry. That permits commercial use and modification as long as the copyright and permission notices are retained.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/lokesh-lightbox2)