Topic: lightbox example not working as provided
billywinter pro asked 6 years ago
Tobicic free answered 5 years ago
I guess calling the include is not working. Copy content of /mdb-addons/mdb-lightbox-ui.html directly into index.html instead of container "< div id="mdb-lightbox-ui">" from your snippet then it works perfecty on webserver as well as local. In that case you also do not have to call function $("#mdb-lightbox-ui").load("mdb-addons/mdb-lightbox-ui.html");
cwilly pro answered 5 years ago
Hello Mikolaj, I've tested again and Lightbox is working correctly as expected from my web server, with Url starting by http://...
It's not working on local:
I have imported all files and your demo on local and try to load with a URL like file://...
in this case I see errors from console.
Thanks for your support.
Mikołaj Smoleński staff commented 5 years ago
It looks like for some reason the script is blocked while You're working on localhost or the path is not correct.
Best
Mikołaj Smoleński staff answered 6 years ago
$("#mdb-lightbox-ui").load("mdb-addons/mdb-lightbox-ui.html");
cwilly pro answered 6 years ago
Mikołaj Smoleński staff answered 6 years ago
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Material Design Bootstrap</title <!-- Font Awesome --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- Bootstrap core CSS --> <link rel="stylesheet" href="css/bootstrap.min.css"> <!-- Material Design Bootstrap --> <link rel="stylesheet" href="css/mdb.css"> <!-- Your custom styles (optional) --> <link rel="stylesheet" href="css/style.css"> <style rel="stylesheet"> .container { margin-top: 50px; } </style> </head> <body> <div class="container"> </div> <!-- SCRIPTS --> <!-- JQuery --> <script type="text/javascript" src="js/jquery-3.2.1.min.js"></script> <!-- Bootstrap tooltips --> <script type="text/javascript" src="js/popper.min.js"></script> <!-- Bootstrap core JavaScript --> <script type="text/javascript" src="js/bootstrap.min.js"></script> <!-- MDB core JavaScript --> <script type="text/javascript" src="js/mdb.js"></script> <script> $(document).ready(function () { }); </script> </body> </html>
billywinter pro answered 6 years ago
billywinter pro answered 6 years ago
billywinter pro answered 6 years ago
billywinter pro answered 6 years ago
Mikołaj Smoleński staff answered 6 years ago
// MDB Lightbox Init
$(function () {
$("#mdb-lightbox-ui").load("mdb-addons/mdb-lightbox-ui.html");
});
Please make sure if there is mdb-addons directory in Your project. If everything is ok please check also if there is any error in Your console (F12).
Best Regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: desktop pc
- Browser: chrome
- OS: windows 10
- Provided sample code: No
- Provided link: No