gitmyhub

Magnific-Popup

JavaScript ★ 11k updated 2y ago

Light and responsive lightbox script with focus on performance.

Magnific Popup is a deprecated MIT-licensed jQuery lightbox plugin that opens images, videos, and HTML in a centered overlay. The author now recommends native browser dialogs for modals and their newer PhotoSwipe library for galleries.

JavaScriptjQueryZepto.jssetup: easycomplexity 1/5

Magnific Popup is a JavaScript plugin that adds lightbox and popup functionality to websites. A lightbox is the effect you see when you click an image on a website and it expands into an overlay in the center of the screen, with the rest of the page dimmed behind it. Magnific Popup handles that display pattern for images, videos, inline HTML content, and other elements. It was a popular choice for years because it worked well across different browsers and mobile devices while remaining small in file size.

The plugin is built for jQuery and Zepto.js, two JavaScript libraries that were widely used for interactive web features before more modern development approaches became common. It requires including jQuery on a page before Magnific Popup will work.

Important context: the README begins with a deprecation notice. The author states that Magnific Popup is no longer under active development and will receive only critical or security bug fixes going forward. For basic popups and modals, the README recommends using the browser's built-in dialog HTML element, which modern browsers support natively. For image galleries, the author built a newer library called PhotoSwipe and recommends that instead.

Community extensions exist for several content management systems, including Drupal, Concrete5, Redaxo, and Contao. Prebuilt distribution files are included in the repository's dist folder, so most users can drop the plugin into their project without a build step. It can also be installed via npm or Bower.

The code is MIT licensed and was created by a developer named Dmitry Semenov along with community contributors.

Where it fits