LIGHTBOX in Ajax multi-step form not working

By: Lorenz Widmaier | Asked: 01/23/2024
ForumsCategory: General questionsLIGHTBOX in Ajax multi-step form not working
Lorenz Widmaier asked 10 months ago
Hi all, I have Ajax multi-step form and some images in a html field. These images are linked to the "Media File" and so a click on them should trigger a lightbox. However, this is not working (I've tried nearly all available lightbox plugins, such as Foobox, Responsive Lightbox, Easy FancyBox etc.). The problems seems to be that when the html field with the image is loaded via Ajax, then the Lightbox is not triggered.  Does anyone knows a solution for this? Many thanks for your help! <3 
Lorenz
2 Answers
Victor Font answered 10 months ago
The JavaScript/jQuery for your lightbox plugin doesn't sound like it's being loaded. It's not now possible to know for certain without examining your site. Not sure how to help you.
Lorenz Widmaier answered 10 months ago
Thanks Victor for guiding me to the right place. Finally, I could make it work with the plugin "Wonder Lightbox" + adding the following short script in a html field at the right step of the multi-step form:
jQuery(".wplightbox").wonderpluginlightbox();
This script script re-inits the lightbox. Unfortunately, this plugin is not for free. I'm sure that the same can be achieved with a plugin such as "Easy FancyBox", but I couldn't figure out how.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right