Home › Forums › Design › Help with navbar show/hide + animations › Reply To: Help with navbar show/hide + animations
February 25, 2018 at 12:59 pm
#267484
Shikkediel
Participant
Ah, okay. Little trick with event propagation:
$(function() {
var guide = $('.navbar-item');
$(window).on('mouseup touchend', function() {
if (guide.hasClass('active')) guide.removeClass('active');
});
$('.navbar-wrap').on('mouseup touchend', function(e) {
e.stopPropagation();
});
$('.menu-icon').click(function() {
guide.toggleClass('active');
});
});