cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed header

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Fixed header

Hi,

 

I want a fixed header like on aliexpress.com, anyone knows how to do this?

 

Thanks

1 REPLY 1

Re: Fixed header

Hi @HvdB 

 

First of all I won't call myself a frontend developer, but with my limited knowledge you can do this with a little CSS and JS. You can listen on the window scroll event, and change the css class the header depending on how far the client have scrolled.

 

window.addEventListener('scroll', function(e) {
    // Do your stuff here maybe with window.scrollY
});

 

I hope this helps :-)