mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
Set constant for
This commit is contained in:
parent
08b1a5da88
commit
051b00e6bc
1 changed files with 4 additions and 3 deletions
|
@ -3,9 +3,10 @@ const $navLinks = $('.main-nav--links');
|
|||
const $navToggle = $('.main-nav--toggle');
|
||||
const navBreakpoint = 730; // this should match $nav-breakpoint in _nav.scss
|
||||
const $mainContent = $('#main-content');
|
||||
const $mainNav = $('#main-nav');
|
||||
|
||||
$(document).ready(function() {
|
||||
$mainContent.css('min-height', $('#main-nav').outerHeight() - $('#main-nav-ctas').outerHeight());
|
||||
$mainContent.css('min-height', $mainNav.outerHeight() - $('#main-nav-ctas').outerHeight());
|
||||
});
|
||||
|
||||
$navToggle.click(function() {
|
||||
|
@ -25,9 +26,9 @@ const footerOffsetTop = $("#main-footer").offset().top;
|
|||
var navOffsetBottom;
|
||||
|
||||
function toggleFixedNavPosition() {
|
||||
navOffsetBottom = $("#main-nav").outerHeight() + $(window).scrollTop();
|
||||
navOffsetBottom = $mainNav.outerHeight() + $(window).scrollTop();
|
||||
|
||||
$("#main-nav").toggleClass("is-fixed-bottom", footerOffsetTop < navOffsetBottom)
|
||||
$mainNav.toggleClass("is-fixed-bottom", footerOffsetTop < navOffsetBottom)
|
||||
}
|
||||
|
||||
toggleFixedNavPosition();
|
||||
|
|
Loading…
Reference in a new issue