Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Multiple expanders per page doesn't work #350

Closed
birdsarah opened this issue Jan 4, 2016 · 2 comments
Closed

Multiple expanders per page doesn't work #350

birdsarah opened this issue Jan 4, 2016 · 2 comments

Comments

@birdsarah
Copy link

I switched to the following html and js with good results:

<div class="expander">
  <a href="javascript:void(0)" class="expander-trigger expander-hidden">Expandable section</a>
  <div class="expander-content">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio mollitia fugiat facilis enim accusamus quisquam aut, repellendus incidunt quod optio facere labore illo numquam ipsum beatae vero debitis, fugit excepturi.</p>
  </div>
</div>
  $('.expander-trigger').click(function(){
    $(this).toggleClass("expander-hidden");
  });

Also worth noting that the following lines currently listed int he JS don't do anything:

  var expanderTrigger = document.getElementById("js-expander-trigger");
  var expanderContent = document.getElementById("js-expander-content");
@Magnus-G
Copy link
Contributor

@birdsarah thanks for catching those redundant lines! And thanks for that solution to multiple expanders! Nice work.

@Magnus-G
Copy link
Contributor

Magnus-G commented Apr 8, 2016

a0e48b4

@Magnus-G Magnus-G closed this as completed Apr 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants