From 637143e5a9cbad062ce652adf066dc1d8fae2c53 Mon Sep 17 00:00:00 2001 From: ding-ma Date: Sat, 29 Aug 2020 13:03:04 -0400 Subject: [PATCH] fixed navbar on form open --- public/scroll.js | 23 ++++++++++++----------- src/Components/About.tsx | 5 +++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/public/scroll.js b/public/scroll.js index 8c534c9..cf6b8c4 100644 --- a/public/scroll.js +++ b/public/scroll.js @@ -3,10 +3,12 @@ window.onscroll = function () { var scrollY = window.pageYOffset || document.documentElement.scrollTop; var header = document.querySelector('nav'); - scrollY <= this.lastScroll - ? header.style.visibility = 'visible' - : header.style.visibility = 'hidden'; - + if (scrollY <= this.lastScroll) { + header.style.visibility = 'visible' + } else { + header.style.visibility = 'hidden' + header.style.display = "" + } this.lastScroll = scrollY; } @@ -17,10 +19,9 @@ $(function () { }); }); -//doesnt work to hide navbar with modal -// $(document).ready(function () { -// $("button").click(function () { -// console.log("123"); -// $('.navbar-collapse').collapse('hide'); -// }); -// }); +$(document).ready(function () { + $("#contact").click(function () { + // document.querySelector('nav').style.visibility = 'hidden'; + $("nav").hide(); + }); +}); diff --git a/src/Components/About.tsx b/src/Components/About.tsx index 9feff9f..48fa9cb 100644 --- a/src/Components/About.tsx +++ b/src/Components/About.tsx @@ -147,7 +147,8 @@ class About extends Component {
-
@@ -156,7 +157,7 @@ class About extends Component { {renderForm()}