Created
January 17, 2018 16:16
-
-
Save xy0/753c61bfb8e270ee48a4fb4f6659be32 to your computer and use it in GitHub Desktop.
Use JS to change + to - in your WP accordions.
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
$('.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