Close Modal with Accordion on Click of Sub Item

We’re going to get pretty specific with this one!

I have a content area element on a glossary page that slides out a list of terms on mobile. I’m using an accordion to group the terms together, from A to Z.

Code looks like this:

[accordion] 
[accordion_item title="A"]
<p class="psidebar" data-x-toggle-close="1"><a href="#acapella">A Capella</a></p>
<p class="psidebar" data-x-toggle-close="1"><a href="#accelerando">Accelerando</a></p>
[/accordion_item] 
[accordion_item title="B"]
(content)
[/accordion_item] 
(etc.)
[/accordion]

The data-x-toggle-close=“1” will toggle close the accordion on click but this is not the desired action. I’d like to click a term in the glossary and have the modal close.

Please advise.

Hi Justine,

Thanks for reaching out.

Since accordion is not connected to off canvas, and there are multiple close buttons from different off canvas and modal elements, then please change your content to something like this

`

Cadenza

`

Or, simply add this to Theme Options > JS just once

jQuery( function($) {

$('.psidebar').on('click', function() {

$('#e245-10-off-canvas .x-off-canvas-close').click(); 

} );

} );

Hope this helps.

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