Skip to content

Instantly share code, notes, and snippets.

@xy0
Created January 17, 2018 16:16
Embed
What would you like to do?
Use JS to change + to - in your WP accordions.
$('.panel-heading').click(function(){
$('#ew-accordian').find('a').each(function(){
$(this).attr('data-before','+');;
});
if( $(this).find('a').attr('aria-expanded') == 'true' ) {
$(this).find('a').attr('data-before','+');
} else {
$(this).find('a').attr('data-before','-');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment