From c4b16130c2200df59dcca4d9e1c9ba4bfec4037f Mon Sep 17 00:00:00 2001 From: Suman Jyoti Phukan Date: Thu, 26 Oct 2023 17:39:38 +0530 Subject: [PATCH] fixed-layout --- src/components/Header-section/Navbar.jsx | 125 ++++++++++++++--------- 1 file changed, 78 insertions(+), 47 deletions(-) diff --git a/src/components/Header-section/Navbar.jsx b/src/components/Header-section/Navbar.jsx index 1b5b4e98..a8053fcc 100644 --- a/src/components/Header-section/Navbar.jsx +++ b/src/components/Header-section/Navbar.jsx @@ -21,28 +21,24 @@ const Navbar = () => { }; }, []); - - - if(showMenu){ - - const scrollTop = - window.pageYOffset || document.documentElement.scrollTop; - const scrollLeft = - window.pageXOffset || document.documentElement.scrollLeft + if (showMenu) { + const scrollTop = window.pageYOffset || document.documentElement.scrollTop; + const scrollLeft = + window.pageXOffset || document.documentElement.scrollLeft; window.onscroll = () => { - window.scrollTo(scrollLeft, scrollTop) - } + window.scrollTo(scrollLeft, scrollTop); + }; - return( + return ( <> -
+
@@ -56,17 +52,53 @@ const Navbar = () => {
- ) - } - else{ - window.onscroll = () => {} + ); + } else { + window.onscroll = () => {}; } return ( @@ -120,13 +151,13 @@ const Navbar = () => { - +
{ id="navbar-sticky" >