Topic: Dynamic loading with javascript
mgwalk free asked 1 month 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 month 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 1 month ago
You can add Lightbox and eCommerce gallery as plain HTML or add HTML part after pageload and init them with JS init.
mgwalk free commented 1 month ago
how code? ddddddddddddddddddddddddddddd
Kamila Pieńkowska staff commented 1 month ago
This is an example of JS init: https://mdbootstrap.com/snippets/standard/kpienkowska/6287864
mgwalk free commented 1 month ago
mdb.Lightbox does not exists Why is it not in my 8.0?
mgwalk free commented 1 month 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: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 8.0.0
- Device: comp
- Browser: ff
- OS: win11
- Provided sample code: No
- Provided link: No