-
AuthorPosts
-
March 6, 2024 at 7:41 pm #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.
March 6, 2024 at 10:21 pm #1436549Hey 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
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:
Please give this a try.Best regards,
MikeMarch 7, 2024 at 6:07 pm #1436654I’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?
March 8, 2024 at 7:44 am #1436698Hi,
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,
IsmaelMarch 8, 2024 at 2:42 pm #1436738I 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.March 8, 2024 at 3:13 pm #1436743Hi,
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,
MikeMarch 8, 2024 at 3:17 pm #1436744Oh! You’re a genius. That fixed it. Thank you!!
March 8, 2024 at 3:20 pm #1436746Hi,
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 -
AuthorPosts
- The topic ‘Change Image on Accordion Tab Click’ is closed to new replies.