I have two arrows(up and down) that toggle colors. This works great except I have a few problems with it.
when the arrow is clicked again, I want the color to go back to its original color but it stays as changed color until I click the other arrow.
I for-loop these arrows, and for instance if I have two set of arrows(two ups and two downs) and when I manipulate one set of arrows then the other set goes back to its original state.
even when logged out user clicks the arrow, the color still changes.
Can someone please help me to achieve the above goals?
This is what I have right now.
<a href="/post/{{ post.slug }}/vote?is_up=1" class="vote">
<span class="glyphicon glyphicon-triangle-top col-md-12" aria-hidden="true"></span></a>
<br />
<span class="col-md-12" style="height:1px; font-family: 'Passion One', cursive; bottom:10px; padding-left:0.01em;
"><h4 id="vote_count_{{ post.slug }}">{{ post.get_vote_count }}</h4></span> <br>
<a href="/post/{{ post.slug }}/vote?is_up=0" class="vote">
<span class="glyphicon glyphicon-triangle-bottom col-md-12" aria-hidden="true"></span></a>
<script>
$(document).ready(function(){
$('.glyphicon').click(function(){
$('.glyphicon').css('color', '#333');
$(this).css('color', '#16A085');
});
});
</script>