1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Divi accordian click to control another element

Discussion in 'Free Divi Community Forum' started by dinobambino, Feb 17, 2025.

  1. dinobambino

    dinobambino New Member

    Hi. I need to be able to use the Divi accordian module but when the user clicks on a title, it displays the relevant image on the right hand side of the screen in the circle as shown in the image here. Any idea if this is possible? There is a different image for each title.
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Block Pro - Premade slide in bar design for your Divi site without using any plugins:View Demo
  2. Divi Booster

    Divi Booster Divi Expert

    Hi dinobambino,

    I don't know of any plugins that provide exactly this functionality, but you could do it with some custom jQuery code.

    The details would depend a bit on your site, but I'd imagine it would end up looking something like this:

    Code:
    Log In or Sign Up to view this code.
    Here I'm assuming the image is an image module with the CSS ID "accordion-image".

    So basically, when the a toggle title is clicked, get its index (i.e. is it the first, second, or third accordion, etc), then look up the image URL of the image that goes with that toggle (e.g. from an array as done above). Finally, replace the current image in your target element with this new image.
     
  3. dinobambino

    dinobambino New Member

    Thank you so much. Your code worked perfectly! I really appreciate the time you took to help me out.
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade dynamic background hover design for your Divi site without using any plugins:View Demo
  4. Divi Booster

    Divi Booster Divi Expert

    You're very welcome, dinobambino! I'm glad I could help :)