oncode / handorgel

Accessible W3C conform accordion written in ES6.
https://oncode.github.io/handorgel/
MIT License
261 stars 25 forks source link

Different Markup #17

Closed Malin88 closed 1 year ago

Malin88 commented 4 years ago

How can I make it works with markup like this one:

<div class="handorgel">
  <div class="card>
    <h3 class="handorgel__header">
      <button class="handorgel__header__button">
        Title
      </button>
    </h3>
    <div class="handorgel__content" data-open>
      <div class="handorgel__content__inner">
        Content openened by default
      </div>
    </div>
  </div>
  <div class="card>
    <h3 class="handorgel__header">
      <button class="handorgel__header__button">
        Title
      </button>
    </h3>
    <div class="handorgel__content" data-open>
      <div class="handorgel__content__inner">
        Content openened by default
      </div>
    </div>
  </div>
</div>

?

oncode commented 4 years ago

Hi @Malin88 Not possible currently, but I could implement it to make it work with every kind of markup.

oncode commented 1 year ago

Now with the new options headerElements and contentElements, you can change the markup like in your example.