Topic: lightbox gallery options
billywinter pro asked 6 years ago
Jakub Mandra staff premium answered 6 years ago
billywinter pro answered 6 years ago
Piotr Glejzer staff answered 6 years ago
// MDB Lightbox Init
$(function () {
$("#mdb-lightbox-ui").load("mdb-addons/mdb-lightbox-ui.html");
});
and paste it to new script tag below our scripts in your package.
Next step is that you have to include code with your images like that :
<div class="row"> <div class="col-md-12"> <div id="mdb-lightbox-ui"></div> <div class="mdb-lightbox no-margin"> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(117).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(117).jpg" class="img-fluid"> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(98).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(98).jpg" class="img-fluid" /> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(131).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(131).jpg" class="img-fluid" /> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(123).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(123).jpg" class="img-fluid" /> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(118).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(118).jpg" class="img-fluid" /> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(128).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(128).jpg" class="img-fluid" /> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(132).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(132).jpg" class="img-fluid" /> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(115).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(115).jpg" class="img-fluid" /> </a> </figure> <figure class="col-md-4"> <a href="https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(133).jpg" data-size="1600x1067"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(133).jpg" class="img-fluid" /> </a> </figure> </div> </div> </div>That code required to have 1 empty div with ID = 'mdb-lightbox-ui' and all images should be in wrapper with class mdb-lightbox. You don't need a data-lightbox. Here is working snippet. Best, Piotr
billywinter pro answered 6 years ago
Piotr Glejzer staff commented 6 years ago
Do you have any errors in the console? If you are using our package that we don't have a file like 'lightbox.min.css' or did you create on your own?
Our lightbox code CSS is in mdb.min.css and mdb.min.js.
billywinter pro answered 6 years ago
Piotr Glejzer staff commented 6 years ago
Hi,
It looks like you don't have files so index.html can't find a code to initiate this. Are you sure you are doing everything well?
Best,
Piotr
billywinter pro answered 6 years ago
Piotr Glejzer staff commented 6 years ago
Hi,
I'm referring to that you probably don't use our MDB Pro version or you have some wrong paths to mdb files.
I copied and pasted your HTML code what did you paste 5 days ago and I removed the link with 'css/lightbox.min.css' and everything going well.
Are you sure that you are using our PRO version? Do you have some other files to work with your projects? It's a weird situation because lightbox is working well with our MDB Pro version and we don't have any problems with that so probably it's not our fault.
I try to figure out what's problem is but I don't have any problems with that on my site.
What kind of browser do you use?
Best,
Piotr
billywinter pro answered 6 years ago
Piotr Glejzer staff commented 6 years ago
Yes, I will verify. Please send to p.glejzer@mdbootstrap.com. I will check.
cwilly pro commented 6 years ago
Hello,
I've also tested with MDB-Pro_4.5.14 and I have exactly the same problem.
no reaction when you click on images
Piotr Glejzer staff commented 6 years ago
Hi,
may you show me your code on our snippets ? Thanks.
https://mdbootstrap.com/snippets/
Did you check that you have all files, good paths and folder mdb-addons with 2 files?
Best,
Piotr
cwilly pro answered 6 years ago
Hello Piotr,
I've posted my code, something is missing or not working correctly.
Thanks for your support
https://mdbootstrap.com/snippets/jquery/cwilly/205380
sorry for the delay
Piotr Glejzer staff commented 6 years ago
Hi,
I forked your snippet and everything is working correctly.
Can you check this https://mdbootstrap.com/snippets/jquery/piotr-glejzer/209472 ?
But If still is not working, can you check console that you have some errors maybe?
Best,
Piotr
cwilly pro answered 6 years ago
Hello Piotr
Lightbox is working correctly as expected from my web server, with Url starting by http://...
I see errors from console when I load file from local directory.
I have imported all files and your demo on local and try to load with a URL like file://...
in this case it's not working.
Thanks for your support.
Piotr Glejzer staff commented 6 years ago
Hello,
Lightbox will work locally if will use live-server.
Best,
Piotr
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: desktop
- Browser: chrome
- OS: windows 10
- Provided sample code: No
- Provided link: No