Skip to content

Version 2.0.0-beta.0 release

Pre-release
Pre-release
Compare
Choose a tag to compare
@sachinchoolur sachinchoolur released this 18 Apr 13:02

Version 2.0

Subscribe to get notified on the stable release. - ProductHunt

  • Completely re-wrote from scratch in typescript
  • Removed jQuery dependency
  • Moved all modules to the main repo for better maintainability.
  • Dropped IE 8 and 9 support. Let me know if you still need support for IE 8 and 9. I’ll consider adding a plugin to add support if there is enough demand.
  • Website
  • Docs
  • Demos

New features

  • Pinch to zoom
  • Virtual slides
  • Swipe to close
  • Zoom from the origin
  • Inline gallery
  • Next-generation image formats support(webp, JPEG XL). etc
  • Better customizability
  • Better performance on mobile devices.
  • Dynamically add, remove slides while the gallery is open
  • Comment interface
  • and much more.

How to upgrade

To make the upgrade seamless, v2 follows the API structure as much as possible. But, few settings are removed and a lot of additional settings are added, the way we use public methods is changed slightly and few events are renamed.

Initialization
V2 doesn’t require jQuery as a dependancy.

lightGallery(document.getElementById('lightgallery'), {
  plugins: [lgZoom, lgThumbnail,]
  speed: 500
  ... other settings
});

Plugins To avoid polluting global scope, since v2 plugins has to be passed via settings.

lightGallery(document.getElementById(‘’lightgallery), {plugins: [lgZoom, lgAutoplay, lgComment, lgFullscreen , lgHash, lgPager, lgRotate, lgShare, lgThumbnail, lgVideo]});
  • Removed in-built support for Dailymotion VK. We Will be adding separate plugins for DailyMotion and Vimeo support
    Added Wistia support
  • HTML videos - Videos can be passed via data-video attribute instead of passing it via hidden div
data-video='{"source": [{"src":"/videos/video1.mp4", "type":"video/mp4"}], "attributes": {"preload": false, "controls": true}}'
  • Events are renamed - Please take a look at the documentation
  • Few settings are added, removed, or renamed.
    Rather than listing down all the changes here, I’d recommend going through the current settings that you are using and compare them with the new documentation.