I'm struggling to simplify and optimize this block of code. Would appreciate any help in making it more efficient!
var status = "closed";
$(document).on('click', '[data-toggle-nav]', function(event) {
if ($(this) && status === "closed") {
console.log('closing');
$('#top').css('transform', 'rotate(45deg)').css('top', '10px');
$('#mid').css('transform', 'rotate(-45deg)').css('top', '10px');
$('#bot').css('display', 'none');
status = "open";
}
else if ($(this) && status === "open") {
console.log('opening');
$('#top').css('transform', 'rotate(0deg)').css('top', '0px');
$('#mid').css('transform', 'rotate(0deg)').css('top', '10px');
$('#bot').css('display', 'block');
status = "closed";
}
});