Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1436535

    Similar to this solution for Elementor (https://urielsoto.com/change-image-on-accordion-tab-click-in-elementor-pro/), I was wondering if there’s a way to have a 2 column layout – accordion in right column and an image in left column – where the image in the left column changes when you click on a different accordion title.

    #1436549

    Hey teamvelocitymarketing,
    I used two columns, one with a accordion, the other with a image element and add the custom class to the image element like in the video: toggle-img
    Enfold_Support_4930.jpeg
    then I used this jQuery like in the video:

    
        jQuery(function() {
    const img = "";
      jQuery('p[data-fake-id="#toggle-id-1"]').click(function(){
        jQuery(".toggle-img img").attr('srcset',img);
         jQuery(".toggle-img img").attr('src',img);
      });
    });

    note I made the adjustment for Enfold ‘p[data-fake-id=”#toggle-id-1″]’ just change #toggle-id-1 to #toggle-id-2 for the second toggle, etc
    I used the code block element for the jQuery with the “script” tags:
    Enfold_Support_4932.jpeg
    Please give this a try.

    Best regards,
    Mike

    #1436654

    I’ve followed your instructions to a T, but the images still aren’t changing when I click on each of the accordion titles. Can you take a look to see if I’m missing something?

    #1436698

    Hi,

    Thank you for the update.

    We are seeing a lot of errors in the console, generated from the avia-footer-script file. Please temporarily disable the Enfold > Performance > File Compression settings, then post the login details in the private field so that we can check the modifications further.

    Uncaught TypeError: Cannot read properties of undefined (reading 'value')
        at a (avia-footer-scripts-4446f5f720adf5f7e6dda8b47a7ba11b---65ea6d5d939f8.js:123:540)
    

    Best regards,
    Ismael

    #1436738

    I had a few issues when I updated theme versions last, but I thought the issues were fixed. Thank you for taking a look.
    I copied the site over to a staging environment so we could test. And disabled the compression settings for now.

    #1436743

    Hi,
    I see that you changed the accordion titles from “p” to “h3” in the element options so the script also must reflect this, I adjusted it for you and now it works. please check.

    Best regards,
    Mike

    #1436744

    Oh! You’re a genius. That fixed it. Thank you!!

    #1436746

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Change Image on Accordion Tab Click’ is closed to new replies.