Materialbox doesn't work for me when I am trying to load the image dynamically using ajax call. When I hard code the image then it works flawlessly.
Any help is really appreciated.
Thanks!
Fixed it. As the ajax call completes, i loaded the image in the DOM and then reinitialized .materialbox using this $('.materialboxed').materialbox();
Hope this helps others.
Thanks Materializecss team for providing such an awesome framework. :smile:
Do you have an example of your code? Please
Can you please explain further. Am having the same issue wether images are loaded dynamically or hard coded
I ran into this same issue and I've try putting $('.materialboxed').materialbox(); at the end of my ajax call but that didn't work so I try the below code and it work. Notes: use the update() lifecycle
updated() {
$('.materialboxed').materialbox();
},
Hope this help someone who ran into the same issue.
Most helpful comment
Fixed it. As the ajax call completes, i loaded the image in the DOM and then reinitialized
.materialboxusing this$('.materialboxed').materialbox();Hope this helps others.
Thanks Materializecss team for providing such an awesome framework. :smile: