Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

88
Views
make Hamburger Nav sticky on Scroll and responsive on all mobile media queries

I am trying to make the navbar Hamburger on mobile view responsive and sticky on scroll on 320px, 375px, and 425px screen sizes. I would like to have a solution in vanilla js and CSS. https://360-consulting-test-2022.661300286228.hostingkunde.de/

.g-offcanvas-toggle {
background: #4B7EC0;
color: #fff;
top: 55px;
right: 15px;
border-radius: 3px;
transition: none !important;
-webkit-transition: none !important;
-moz-transition: none !important;}

@media (max-width: 425px) {
.g-offcanvas-toggle {
    top: 67px !important;
}

@media only screen and (min-width: 320px) and (max-width: 375px) {
g-offcanvas-toggle {
 top: 60px !important;
}

@media (max-width:320px) {
.g-offcanvas-toggle {
       top: 90px !important;
   }
}

and I tried this jquery code but I want to use it in vanilla js so that it works properly.

var header = $('#g-navigation');
var offcanvas = $('.g-offcanvas-toggle');
var headerHeight = header.outerHeight();
var stickyHeaderTop = header.offset().top;

var stickyHeader = function () {
var scrollTop = $(window).scrollTop();
if (scrollTop > stickyHeaderTop) {
offcanvas.css('position', 'fixed').css('top','20px');
} else {
offcanvas.css('position', 'absolute').css('top', '55px');
}
};
stickyHeader();
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!