Changelog
Version history of Media Boxes. Version 4.0.0 is a full rewrite as a zero-dependency custom element with a built-in lightbox. Includes the history of version 3.x (jQuery).
4.0.0 (2026-12-01) #
Version 4.0.0 is a rewrite from scratch, delivered as an update to the same item. It is not compatible with version 3 markup, options or CSS. See the migration guide for how to convert a version 3 site. The download does not include the jQuery plugin, so keep a copy of your version 3 files before updating. Sites that use version 3 keep working, and you can stay on it as long as you want.
The engine #
- New
<media-boxes>custom element. You add a stylesheet, a script and a tag. There is no init call. - No dependencies. jQuery, Isotope, imagesLoaded, Transit, jQuery Easing, jQuery Visible, Modernizr, Fancybox, Magnific Popup and Font Awesome are no longer used.
- Content stays in the page as normal HTML, so it is indexable and works without JavaScript as a plain CSS grid.
- Every option can be set as an attribute, in a JSON block inside the element, or from JavaScript.
- Layout is calculated from the width of the grid, not the window, so grids work in sidebars and columns.
- Right-to-left layouts, keyboard support, visible focus and
prefers-reduced-motionare supported. - Light, dark and automatic themes through CSS custom properties (
--mb-*). The stylesheet is in a CSS layer, so your own CSS wins without!important. - Supported browsers: current Chrome, Edge, Firefox and Safari 16.4 or newer. Internet Explorer is no longer supported. The automated test suite runs in Chromium, Firefox and WebKit.
Layouts and look #
- Four layouts: masonry, grid, justified rows and mosaic.
- Six skins: card, plain, caption, overlay, hover and image.
- Ten overlay effects (fade, slide in four directions, reveal, zoom, blur, direction-aware) and seven image effects (zoom, zoom out, grayscale, color, blur, 3D tilt, none).
- Five enter animations (none, fade, fade up, scale, flip) with stagger.
- Automatic breakpoints derived from the column count, or your own list.
- Items can be built from plain data objects, with price, author, badge, extra meta and custom overlay text. Prices are formatted for the currency and locale you choose.
- Play icon and duration chip on video items.
Filtering, search, sort and loading #
- Filters built from your item data, as buttons, tabs or a select, with optional counts, multi-select, several groups and AND or OR logic between groups.
- Search that matches every word, ignores accents, and can look in any field you choose.
- Sorting by title, date, original order, random or any data attribute, with an order button.
- Four loading modes: load more button, infinite scroll, numbered pages, or show all.
- External controls: any button or input on the page can drive a grid with
data-mb-for. - Deep links for filter, search and open lightbox item, with several grids on one page.
- Empty state and a live status for screen readers.
Lightbox #
- One built-in lightbox. It replaces Fancybox and Magnific Popup.
- Images, video files, YouTube, Vimeo, iframes and inline HTML.
- Zoom (button, double tap, wheel, pinch), pan, swipe to change slide, swipe down to close, thumbnail strip, slideshow, fullscreen, download and share buttons. Share sends the deep link to the photo (and slide) when deep links are on.
- Open and close animation from the thumbnail, with spring motion and inertia (or plain easing if you prefer).
- Configurable toolbar, custom toolbar buttons,
srcsetfor large images, keyboard map, wheel behavior, idle behavior and preloading. - Events for ready, slide loaded, slide error, zoom and a cancelable before-close.
- Several slides in one grid item: a hidden
.mb-gallerylist (ormedia.galleryin JSON), a count chip on the tile, inline or isolated order (lightbox.itemGallery) and deep links to a slide (&slide=3). - Video that plays inside the grid:
videoPlay: 'inline'ordata-mb-play, YouTube and Vimeo loaded only on click, one player at a time, a stop button, and the eventsmb:video-playandmb:video-stop.
JavaScript API #
- Methods on the element:
filter,search,sort,loadMore,goToPage,addItems,removeItems,refresh,layout,openLightbox,closeLightbox,getSlide,getZoom,destroy. - Events on the element:
mb:ready,mb:layout,mb:filter,mb:load,mb:open,mb:change,mb:closeand the lightbox events.
Removed in 4.0.0 #
These version 3 features have no equivalent. The migration guide lists a workaround for each.
- The choice between Fancybox and Magnific Popup, and their library-specific options.
- The ajax popup content type.
- Per-box overlay effect,
data-extra-height, and negative spacing. - Selector-based filters, checkbox and radio filters, and
data-visible-only-if. - Font Awesome and the Facebook, Twitter, Google+ and Pinterest share buttons.
3.x #
Versions 3.0 to 3.7.4 are the jQuery plugin built on Isotope. Their history comes from the version 3 source files and their file headers.
- 3.7.4 (2021): Updated jQuery and the bundled components. Strict mode enabled. Fix for the OR filter logic when a search is active and every filter is set to All.
- 3.7.3 (2021): Fix for deep links with checkbox filters when opening the page from a link.
- 3.7 (2020):
resolutionsis replaced instead of merged with the defaults. Fix forwaitForAllThumbsNoMatterWhat. Thedata-thumbattribute for Fancybox thumbnails restored. Fix when no options are passed. - 3.6 (2019 to 2020): Fixes for default filters other than All, including the first item on hover. Fancybox thumbnails work for file names with spaces. The load more button no longer reacts to other grids on the page. Waypoints no longer needed.
- 3.5 (2019): New design. Checkboxes as multiple filters. Show or hide a filter item based on another (
data-visible-only-if). Fix for the loading animation. - 3.0 (2016 to 2018): Fancybox joins Magnific Popup. New
insert_in_flowmethod. Optional extra height per box (data-extra-height). OR logic for multiple filters. Click or hover for dropdown menus. Select element as filter. Namespaced Isotope and Fancybox to avoid conflicts. Hardware-accelerated boxes. New search and sort design. SEO attributes on thumbnails. - Earlier releases (2013 to 2016): the first jQuery versions. The detailed history before 2016 is not available in the source repository.