Link "Classic Creative CTA" to open Accordion

Hi,

I am trying to figure out if it is possible to have a “href link” open and close an accordion.

In more detail I have a “Classic Creative CTA” element on my page and need to open an accordion that is located right beneath it, when clicking on the “Classic Creative CTA”. The accordion itself is a simple shortcode accordion:

[accordion id=“my-accordion”] [accordion_item title=“Accordion Title” parent_id=“my-accordion”]Your text here[/accordion_item]

Is it possible to achieve opening and closing the accordeon when clicking on the “Classic Creative CTA” element?

site address is: www.kabine5.de/wordpress
pw for viewing is: deinekreativewebseite

Hi Phil,

Please add this code to Appearance > Theme Options > JS

jQuery('.x-creative-cta').on("click touchend", function (e) {
	e.preventDefault();
	jQuery('.x-accordion-toggle').trigger('click');
})

Hope that helps.

1 Like

Hi Christian,

this works beautifully! Thank you :slight_smile:

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.