I have list of links, and if you click on any of them, it will toggle show/hide text below it in separate div. Also it hides all other divs if one of them is shown
This code manages it:
$(document).ready(function(){
$('.targetDiv').hide();
$('.hideshow').click(function () {
$('#div' + $(this).attr('target')).toggle('').siblings('.targetDiv').hide('');
});});
And this is what the link looks like
<a class="hideshow" target="1"><div class="cennikPlus"><i class="fa fa-plus-square"></i></div>Something something</a>
What i need to do is to change
fa-plus-square
to
fa-minus-square
when open and back, when closed.
I found "toggleClass" which should be useful in this case, but I am not sure how to select i inside div inside a
Can you help me with this?
Also the website is here
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…