I have a small quick issue that I can't get my head wrapped around. Please take a look at this jsfiddle: https://jsfiddle.net/1efo87j1/1/
I'm showing and hiding specific items on click of two buttons. What I can't achieve is that if the button has a class of active already, I would like to hide the items that appear.
// set content on click
$('.jpn').click(function (setCont) {
setCont.preventDefault();
setContent($(this));
});
function setContent($el) {
$('.jpn').removeClass('active');
$('.foodNavi').hide("slow");
$el.addClass('active');
$($el.data('rel')).show("slow");
}