2
I wanted to make a certain element disappear with the fadeOut() command when clicking on a button, and when clicking again, it appeared with fadein(). I tried to do something like:
$('nav.mobile h3.shopping-bag').fadeOut();
if ($('nav.mobile h3.shopping-bag').fadeOut() === true){
$('nav.mobile h3.shopping-bag').fadeIn();
} else {
$('nav.mobile h3.shopping-bag').fadeOut();
}
});
However, the logic or some command sequence is wrong. Can anyone help me? Ps: I would like something similar to swap and unlock the color of an element using the same logic when I click.
Oh yes, now I understand. Thank you so much for your help! I will apply the solution.
– Cyb3rz