How to close an accordion when clicking on another one

  • Posted in : Read WP
  • acielouvert
    Participant

    Hello,

    I’m using 3 “accordions” on a page. One is open (active). I would like to close the open accordion when clicking on the other. So when I click a close accordion it open it and close the one who was previously open.

    So I won’t have all accordions open all the time but just one.

    [accordion active="active" title="ENG"] my content [/accordion]

    Thank you

    acielouvert
    Participant

    Hello, I try out some code but unfortunatly was not able to succed.
    Any chance you know how to ?
    That would be perfect.
    Thank you

    ahmetsali
    Keymaster

    hi, can you provide your page url with the accordions?

    ahmetsali
    Keymaster

    i see you have used toogle shortcode, use accordion shortcode instead.

    [accordions]
    	[accordion active="active" title="accordion 1"]Put your content here.[/accordion]
    	[accordion title="accordion 2"]Put your content here.[/accordion]
    [/accordions]
     
    active="" ... active keyword is for opened style
     
    title="" ... the caption text of the accordion
    
    acielouvert
    Participant

    Wrapping the accordions around [accordions] [/accordions] make it work.
    Thank you.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register