Topic: Dynamic loading with javascript
mgwalk priority asked 2 weeks ago
this data-mdb-lightbox-init data-mdb-ecommerce-gallery-init or any data-mdb-* does not play well with dynamic load how the heck do it
I cannot just past the divs with data-mdb-ecommerce-gallery-init because magento does not load mdb fast enough
Grzegorz Bujański staff answered 1 week ago
Unfortunately, we have no experience with Magento and it's hard for us to say anything about it.
Our components are loaded as soon as the JS file of MDB package is loaded. If in your case MDB components appear with a delay, it may mean that Magento loads JS files with a delay.
If mdb.Lightbox
doesn't work for you, it may mean that you need to add mdb
to window
:
import * as mdb from 'mdb-ui-kit'; // lib
window.mdb = mdb;
Kamila Pieńkowska staff answered 2 weeks ago
You can add Lightbox and eCommerce gallery as plain HTML or add HTML part after pageload and init them with JS init.
mgwalk priority commented 2 weeks ago
how code? ddddddddddddddddddddddddddddd
Kamila Pieńkowska staff commented 2 weeks ago
This is an example of JS init: https://mdbootstrap.com/snippets/standard/kpienkowska/6287864
mgwalk priority commented 2 weeks ago
mdb.Lightbox does not exists Why is it not in my 8.0?
mgwalk priority commented 2 weeks ago
How do you use the plugins with requirejs-config.js
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 8.0.0
- Device: comp
- Browser: ff
- OS: win11
- Provided sample code: No
- Provided link: No