JSFiddle - React, Tailwind, and code Playground
JavaScript
var thog = thog || {};
thog.navigation = thog.navigation || {};
thog.navigation.Site = {
init: function() {
this.retrieveNavigationElements();
this.bindUIActions();
},
retrieveNavigationElements: function() {
this.elements = {
$toggleButton: $('#js-sidenav-toggle')
};
},
bindUIActions: function() {
this.elements.$toggleButton.on('tap', function(e) {
e.stopPropagation();
e.preventDefault();
$('body').toggleClass('nav-open');
});
}
};
$(function(){
thog.navigation.Site.init();
});