Swap Image Modules at the Click of a Button

Written by Dan Mossop

If you want to swap between two Divi image modules at the click of a button, here's a way to achieve it with the Divi Show / Hide Button module. 

First, create a column with two image modules (one for each image) and then a show / hide button below them, like so:
Use one image module for each of the two images and set each to open in a light box. Give each a CSS ID, e.g. "image1" and "image2"

Configure the show / hide button to hide image2 initially:

And to toggle the two image modules on click:
You might also want to set the transition duration to "0" so that there is no animation during the change. You can do that with this option:

https://divibooster.com/adjusting-the-show-hide-button-transition-duration/

Transform Your Pages with Divi Show / Hide Button!

Unleash the full potential of your Divi site with the Divi Show / Hide Button Module. Control the visibility of sections, rows, or modules with ease, create engaging tabs, and style your buttons just like any other Divi button. Perfect for keeping your pages clean and interactive.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.

We may earn a commission when you visit links on our website.