lightgallery.js | Full featured JavaScript image & video gallery | Widget library
kandi X-RAY | lightgallery.js Summary
kandi X-RAY | lightgallery.js Summary
Full featured JavaScript lightbox gallery. No dependencies.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initialize the plugin .
- Return the image URL for a thumbnail
- Create a custom Event .
- Interpolate the default module
- Convert dash - separated string to camelCase
- Check if full screen is fullscreen .
- exec a module
- wrapper to require
- Main require function
- local require function
lightgallery.js Key Features
lightgallery.js Examples and Code Snippets
Community Discussions
Trending Discussions on lightgallery.js
QUESTION
I have a page that show lots of photos which can be opened with lightgallery.js
I've already made some custom HTML caption which works fine. But now I want to add a label to the image itself. How can I do that?
I will show an example of what my photos page looks like:
When you open an image this is what it looks like:
The left part is a custom HTML caption which I linked with this attribute: data-sub-html
.
Example code of my looped code:
...ANSWER
Answered 2022-Feb-09 at 01:36According to the lightgallery docs, you can use the event lgAfterOpen
to execute code once the gallery is opened. However, lightgallery makes this slightly difficult as you can't access the image clicked on from this event, but you can access it from the event lgBeforeOpen
. With this in mind, I'd accomplish this by doing two things.
Firstly, add the size as a data attribute of each image:
QUESTION
I am trying to create a mixed slider of images and HTML5 videos using lightgallery.js.
Images are shown in slider while video does not play. It gives this error:
Oops..fail to load content
Below are the CSS and JS files included in my project.
Anyone please suggest me whether I am missing any JS or CSS files or the way of creating a slideshow is not correct.
JS part:
...ANSWER
Answered 2021-Aug-11 at 08:51I assume, the different nesting depths might cause the problem.
If you check the official Mixed Contents docs, the code should looks like this:
HTML structure:
QUESTION
I have problems with URL Processing in Laravel mix.
here is my app.css
...ANSWER
Answered 2021-Feb-19 at 20:52First, in webpack.mix.js, do you need the SASS line? Because it's causing issues.
QUESTION
I am currently working on a webpage and tried implementing LightGallery. Although the image galleries work totally fine for me the videos won't seem to play. When I check the console the following error message is displayed upon loading the site:
...ANSWER
Answered 2021-Apr-30 at 07:12Here's a working JSFiddle. Here's what I did, working through the installation page I referenced yesterday:
Starting in the "Include CSS and Javascript files" section, they say to include
lightgallery.css
, though they don't give a link for it. I searched and found a CDN link, and added that ;Copied and added the 'jsdelivr collection' link for the Lightgallery JS;
Copied the JS they show to initiate the plugin;
Copied the relevant part of your HTML snippet - just the
lightgallery
div, with some minor updates:- Neither
video-poster1.jpg
norimg/thumb1.jpg
exist here of course, so I replaced them with placeholder images; - I get "Video unavailable" for that video, so I randomly picked another;
- Neither
This works fine - the placeholder thumbnail is shown, when I click it the video opens against a black background, and plays if I click play. Here's the code:
QUESTION
I have a project using React (frontend) and Django Rest Framework (backend), and it is currently deployed on PythonAnywhere. I'm using axios to connect to my API and load data from my database onto the React frontend.
During development, I hardcoded the username and password for accessing the database into my index.js
file (credentials are obscured below):
ANSWER
Answered 2021-Jan-23 at 16:34You are trying to obscure client data, which (for obvious reasons) resides in the client.
So you can't really obscure it.
You can force the user to login with their credentials, which is how authentication using username and password is done.
QUESTION
I'm trying to run the lightgallery.js script (pure JS version) using querySelectorAll in several classes to no avail.
This is the code I'm using:
...ANSWER
Answered 2020-Aug-25 at 09:44The culprit was the :has()
used in the selector
option in the script. :has()
is a jQuery extension and not part of the CSS specification and, thus, cannot be used in pure JS scripts.
UPDATE:
This is the code I'm using now:
QUESTION
I'm trying to target dynamic added elements to work with lightgallery.js. See the exemple bellow:
...ANSWER
Answered 2020-Jul-08 at 13:45You need to append html to id="animated-thumbs"
before initialising gallery, or reinitialize gallery after appending html.
Something like:
$('#animated-thumbs').lightGallery().destroy(true);
$('#animated-thumbs').append('
some html to add
');
$('#animated-thumbs').lightGallery({ //params });
Please note that this is just description code and it will not work if you just copy it. Check gallery documentation on how to call destroy method (usually they all have it) and apply it to your code. Or if there is 'reinit' method you can skip destroy and just reinit gallery after html appending.
QUESTION
I want to make lightGallery ( https://github.com/sachinchoolur/lightGallery.git ) automatic enter full screen mode with a function call.
But I can't find the way to make it work.
Please help me.
Here is my code
...ANSWER
Answered 2020-Apr-15 at 18:16If you want the image to open automatically on page load, you can accomplish it by adding an id
attribute to the img
element & a click
event to it like so:
HTML:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lightgallery.js
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
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.
You can install lightgallery.js using the npm package manager. You can also find lightgallery.js on Yarn and Bower.
You can also directly download lightgallery from GitHub.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page