Sticky Header - Question | JoomShaper

Sticky Header

K

Kugata

Template 1 day ago

How to make the header sticky in the Helix Ultimate to reappear when scrolling down only?

0
5 Answers
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 23 hours ago #209544

Oh, indeed, but as I said before, this kind JS/CSS customization is on your hands only.

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 day ago #209533

Hi Kugata,

If you have our template, just from settings. Template Options > Basic > Header > Sticky Header: On > Save & Close

I suggest change defult value for Sticky Offset , for example, use 0 or 1.

https://www.joomshaper.com/documentation/helix-framework/basic

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 day ago #209534

If you have template from other seller/developer, you have to ask them , or use Custom CSS to make it possible.


Other header behavior customization, request using Custom CSS/JS and are on your hands only.

0
K
Kugata
Accepted Answer
1 day ago #209539

Paul, you didn't understand my question. I want the header sticky to appear only when scrolling down and disappear when scrolling up. Template Helix Ultimate. Probably it is need to add some extra code to the file main.js?

0
K
Kugata
Accepted Answer
1 day ago #209542

The solution is

  1. To add in the main.js after string 60:

         window.onscroll = function() {
             scrollFunction();
         };
    
         function scrollFunction() {
             const header = document.getElementById("sp-header");
             // Check if scrolling up/down
             if (window.scrollY < window.scroll.previousY) {
                 header.classList.remove("header-hidden"); // Show header when scrolling up
             } else {
                 header.classList.add("header-hidden"); // Hide header when scrolling down
             }
             window.scroll.previousY = window.scrollY; // Store current scroll position
         }
    
     2. To add some CSS to the template:
     #sp-header{
     transition: all .5s;
     &.header-hidden {
             top: -80px;
           }
        }
0