I want to toggle a chevron in a bootstrap drop down menu, when the drop down is toggled. I can make it toggle when clicked, but I would rather it toggle on drop down that way if you click on another part of the menu the chevron changes back. It currently will stay with the minus sign unless you click the chevron to change it back.
<li class="dropdown navbar-custom first-navbar-custom">
<a href="#" data-toggle="dropdown" class="dropdown-toggle shortNav hidden-md hidden-lg pull-left cheveron-dropdown">
<span class="chevron_toggleable glyphicon glyphicon-plus glyphiconIcon hidden-md hidden-lg">
</span>
</a>
<a href="/glass-containers/c/455/"><strong>Glass Containers</strong>
</a>
<ul class="dropdown-menu">
<script>
$(document).ready(function() {
$('dropdown-toggle').dropdown('toggle', function() {
$('.chevron_toggleable').toggleClass('glyphicon-plus glyphicon-minus');
});
});
</script>
I feel like its really close, I just don't have the jquery part correct can someone please help me and tell me what I am doing wrong.
The fiddle should explain all. https://jsfiddle.net/nu8wmjq5/