*

mixradu

  • ****
  • 171 posts
Tutorial Sticky Header
« on: November 17, 2016, 08:21:12 PM »
Demo : https://www.lannonce.eu

This is a very simple tutorial for a sticky header, and maybe MB-Themes can implement it to "zara configuration"


First we need to add in zara/css/style.css
Code: [Select]
div#top-navi.sticky {
    position: fixed;
    top: 0;
    z-index: 99999;
    padding: 0px 0px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);

And after we need to add in zara/js/global.js
Code: [Select]
//sticky
if($(window).width() <= 479) {
 //nothing will happen
}else
{
  $(window).scroll(function() {
    var scroll = $(window).scrollTop();

    if (scroll >= 33) {
        $("#top-navi").addClass("sticky");
    } else {
        $("#top-navi").removeClass("sticky");
    }
});
}

And if you want animation you can add a "    transition: all 0.4s ease;" in "#top-navi" (style.css)

Welcome

*

MB Themes

Re: Tutorial Sticky Header
« Reply #1 on: November 17, 2016, 08:43:31 PM »
@mixradu
Thanks for tip ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mixradu

  • ****
  • 171 posts
Re: Tutorial Sticky Header
« Reply #2 on: November 17, 2016, 08:45:39 PM »
@mixradu
Thanks for tip ;)

Welcome i am working now in one new scroll header google style (when you scroll down header dissapear and when you scroll up header appear again)

*

MB Themes

Re: Tutorial Sticky Header
« Reply #3 on: November 18, 2016, 09:43:26 AM »
@mixradu
We have it on Monika theme for prestashop, however it is pitty that many customers complained that it disappear when you go top :)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots