Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 23h 06m 24s
Claim 50% off
Solved Templates

Sticky header

Asked by Kugata 1 year ago Last activity 1 year ago

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

Accepted answer

Marked as the solution
Paul Frankowski Senior Staff

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

4 more replies

Paul Frankowski Senior Staff
1 year ago · edited

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.

Kugata Asked this
1 year ago · edited

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?

Kugata Asked this

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;
           }
        }
Log in to reply.