I am in the process of designing a website that includes two clickable divs, "#coloursettings" and "#powersettings". Both of these divs successfully unbind the menu ("#tab a"), but I am struggling to make them deactivate each other upon clicking one, then re-activate when clicked again. I have attempted to enter the corresponding ID into the same method that unbinds/binds the "#tab a", but it does not deactivate the other clickable div. Can anyone provide assistance on how to achieve this functionality?
//Colour Settings Menu//
var clicked1 = true;
$("#coloursettings").click(function() {
$("#colourselect").toggle();
$(".content, .tab").toggleClass('blur');
if (clicked1) {
$("#tab a").unbind("click", foo);
clicked1 = false;
}
else {
$("#tab a").click(foo);
clicked1 = true;
}
});
//Power Menu//
var clicked = true;
$("#powersettings").click(function() {
$("#powermenu").toggle();
$(".content, .tab").toggleClass('blur');
if (clicked) {
$("#tab a").unbind("click", foo);
clicked = false;
}
else {
$("#tab a").click(foo);
clicked = true;
}
});
Relevant HTML
<div class="icon" id="coloursettings">...</div>
<div class="icon" id="powersettings">...</div>