inspec/www/source/javascripts/nav.js
Maggie Walker f79ec02efc Add main site navigation
Also includes integration of Font awesome icons.
2016-09-20 09:23:34 -07:00

16 lines
No EOL
430 B
JavaScript

// Nav Scripts
const $navLinks = $('.main-nav--links');
const $navToggle = $('.main-nav--toggle');
const navBreakpoint = 730; // this should match $nav-breakpoint in _nav.scss
$navToggle.click(function() {
$(this).toggleClass('is-active');
$navLinks.slideToggle();
});
$(window).resize(function() {
if ($(window).width() >= navBreakpoint) {
$navToggle.removeClass('is-active');
$navLinks.attr("style", "");
}
});