Skip to content

Instantly share code, notes, and snippets.

@max
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max/9983845 to your computer and use it in GitHub Desktop.
Save max/9983845 to your computer and use it in GitHub Desktop.
<!doctype html>
<meta charset="utf-8">
<title>Accordion</title>
<style>
selector.eventlistener {
// styling based on e.event
}
selector.eventlistener + selector {
// styling based on sibling e.event
}
selector.eventlistener {
}
</style>
<h1 data-click='p'>About me</h1>
<section>A small text about me.</section>
<h1>My work</h1>
<section>A small text about my work.</section>
<h1>Contact</h1>
<section>Contact me.</section>
<p data-clicked='.foo'>
clicking on "h1" removes class "open" on "h1.open"
clicking on "h1" adds class "open" on "target"
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment