- Notifications
You must be signed in to change notification settings - Fork590
Full featured JavaScript image & video gallery. No dependencies
License
sachinchoolur/lightgallery.js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Full featured JavaScript lightbox gallery. No dependencies.
- lightgallery.js has been merged withlightGallery. That means, v2 of lightgallery.js ishttps://www.lightgalleryjs.com/. if you have a lightgallery.js license, this is valid forlightGallery as well. But, since version 2.0 you need to pass the license key as a plugin option. If you alredy have a license, please contact me atcontact@lightgallery.js for the license key
- Completely re-wrote from scratch in typescript
- 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
Any questions, ideas, suggestions about v2? please start adiscussion.
- 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.
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.
InitializationV2 doesn’t require jQuery as a dependancy.
lightGallery(document.getElementById('lightgallery'),{plugins:[lgZoom,lgThumbnail,]speed:500 ...othersettings});
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 VK 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 thedocumentation
- 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.
- Fully responsive.
- Modular architecture with built in plugins.
- Touch support for mobile devices.
- Mouse drag supports for desktops.
- Double-click/Double-tap to see actual size of the image.
- Animated thumbnails.
- Social media sharing.
- YouTube, Vimeo, Dailymotion, VK and HTML5 video support.
- 20+ Hardware-Accelerated CSS3 transitions.
- Dynamic mode.
- Full screen support.
- Supports zoom.
- Browser history API.
- Responsive images.
- HTML iframe support.
- Multiple instances on one page.
- Easily customizable via CSS (SCSS) and Settings.
- Smart image preloading and code optimization.
- Keyboard Navigation for desktop.
- Font icon support.
- Rotate, flip images.
- Accessibility support.
- And many more.
lightgallery supports all major browsers including IE 9 and above.
You can installlightgallery.js using thenpm package manager.
npm install lightgallery.js
You can also findlightgallery.js onYarn andBower.
yarn add lightgallery.js
bower install lightgallery.js --save
http://www.jsdelivr.com/projects/lightgallery.js
You can also directly download lightgallery from GitHub.
First of all add lightgallery.css in the<head> of the document.
<head><linkrel="stylesheet"href="css/lightgallery.css"></head>
Then includelightgallery.min.js into your document.If you want to include any lightgallery plugin you can include it afterlightgallery.min.js.
<body> ...<scriptsrc="js/lightgallery.min.js"></script><!-- lightgallery plugins --><scriptsrc="js/lg-thumbnail.min.js"></script><scriptsrc="js/lg-fullscreen.min.js"></script></body>
Lightgallery also supports AMD, CommonJS and ES6 modules.When you use AMD make sure that lightgallery.js is loaded before lightgallery modules.
require(['./lightgallery.js'],function(){require(["./lg-zoom.js","./lg-thumbnail.js"],function(){lightGallery(document.getElementById('lightgallery'));});});
lightgallery does not force you to use any kind of markup. You can use whatever markup you want.But i suggest you to use the following markup.Hereyou can find the detailed examples of different kinds of markup.
<divid="lightgallery"><ahref="img/img1.jpg"><imgsrc="img/thumb1.jpg"></a><ahref="img/img2.jpg"><imgsrc="img/thumb2.jpg"></a> ...</div>
Finally you need to initiate the gallery by adding the following code.
<script> lightGallery(document.getElementById('lightgallery'));</script>
If you like lightgallery please support the project by staring the repository ortweet about this project.
- Thumbnails
- YouTube, Vimeo Video Gallery
- HTML5 Video Gallery
- Transitions
- Dynamic
- Events
- Methods
- Iframe. External websites, Google map etc.
- Captions
- Responsive images
- Gallery with fixed size
- HTML Markup
- Facebook comments
- Easing
- History/hash plugin
- Social media share
- Thumbnail -GItHub -Docs
- Autoplay -GItHub -Docs
- Video -GItHub -Docs
- Fullscreen -GItHub -Docs
- Pager -GItHub -Docs
- Zoom -GItHub -Docs
- Hash -GItHub -Docs
- Share -GItHub -Docs
- Rotate -GItHub -Docs
If you want to use lightgallery.js to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.Read more about the commercial license
If you are creating an open source application under a license compatible with the GNU GPL license v3, you may use this project under the terms of the GPLv3.
About
Full featured JavaScript image & video gallery. No dependencies
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors15
Uh oh!
There was an error while loading.Please reload this page.
