dokuwiki-template-landing/assets/offcanvas.js

34 lines
937 B
JavaScript
Raw Normal View History

2021-07-12 18:26:55 +02:00
(function() {
jQuery(function($) {
/* Off-Canvas */
var trigger = $('.hamburger'),
icon = $('.hamburger-icon'),
overlay = $('.overlay'),
isClosed = false;
trigger.click(function () {
hamburger_trigger();
});
function hamburger_trigger() {
if (isClosed == true) {
overlay.hide();
icon.removeClass("fa-times");
icon.addClass("fa-bars");
isClosed = false;
} else {
overlay.show();
icon.removeClass("fa-bars");
icon.addClass("fa-times");
isClosed = true;
}
}
overlay.click(function () {
trigger.click();
});
$('[data-toggle="offcanvas"]').click(function () {
$('#wrapper').toggleClass('toggled');
});
});
})();