mirror of
https://github.com/inspec/inspec
synced 2024-12-26 04:53:24 +00:00
16 lines
430 B
JavaScript
16 lines
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", "");
|
||
|
}
|
||
|
});
|