Created
August 12, 2008 18:58
-
-
Save bryanjswift/5125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>First Accordian</h1> | |
<div class="accordion"> | |
<h3 class="toggler">Heading 1</h3> | |
<div class="element"> | |
<p>Some text</p> | |
</div> | |
<h3 class="toggler">Heading 2</h3> | |
<div class="element"> | |
<p>Some text</p> | |
</div> | |
<h3 class="toggler">Heading 3</h3> | |
<div class="element"> | |
<p>Some text</p> | |
</div> | |
</div> | |
<h1>Second Accordian</h1> | |
<div class="accordion"> | |
<h3 class="toggler">Heading 1</h3> | |
<div class="element"> | |
<p>Some text</p> | |
</div> | |
<h3 class="toggler">Heading 2</h3> | |
<div class="element"> | |
<p>Some text</p> | |
</div> | |
<h3 class="toggler">Heading 3</h3> | |
<div class="element"> | |
<p>Some text</p> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var accords = []; | |
$$('.accordion').each(function(accordionEl) { | |
var togglers = accordionEl.getElements('h3.toggler'); | |
var els = accordionEl.getElements('div.element'); | |
var myAccordion = new Accordion(togglers, els, { | |
opacity: false, | |
onActive: function(toggler, element){ | |
toggler.setStyle('color', '#41464D'); | |
}, | |
onBackground: function(toggler, element){ | |
toggler.setStyle('color', '#528CE0'); | |
} | |
}); | |
accords.push(myAccordion); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment