Created
March 16, 2015 12:35
-
-
Save fieldoffice/ea35b11da55d4c964815 to your computer and use it in GitHub Desktop.
Toggle Text (Accordion)
This file contains hidden or 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
$('.toggle').click(function() { | |
var txt = $(this).next('ol').is(':visible') ? '+' : '-'; | |
$(this).find('span').text(txt); | |
$(this).next('ol').slideToggle(); | |
}); | |
<h3 class="toggle">Header <span>-</span></h3> | |
<ol> | |
<li>Option 01</li> | |
<li>Option 02</li> | |
<li>Option 03</li> | |
</ol> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment