Created
April 29, 2016 11:14
-
-
Save schalkneethling/9a9142a97c0ae641d8bfbd0e92e1e7df to your computer and use it in GitHub Desktop.
Simple accordion
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
(function() { | |
'use strict'; | |
var $statusUnknown = $('.status-unknown'); | |
var $tab = $('caption', $statusUnknown); | |
var $tabPanels = $('thead, tbody', $statusUnknown); | |
var expandedState; | |
$tab.on('click', function() { | |
expandedState = $tab.attr('aria-expanded') === 'false' ? true : false; | |
$tab.attr('aria-expanded', expandedState); | |
$tabPanels.toggleClass('hidden') | |
.attr('aria-hidden', !expandedState); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment