Wsparcie » Motywy » statyczne menu- problem

Viewing 2 replies - 1 through 2 (of 2 total)
  • Kokpit->Wygląd->Opcje motywu

    do sekcji CSS STYLES dodaj (lekko zmodyfikowałem):

    .fixed {
        position: fixed;
        top: 0px;
        left: 0;
        z-index: 100;
        width: 100%;
    
        -webkit-box-shadow: 0 0 40px #222;
        -moz-box-shadow: 0 0 40px #222;
        box-shadow: 0 0 40px #222;
    }
    
    body.admin-bar .fixed {
          top: 32px;
    }

    do sekcji SCRIPTS dodaj (lekko zmodyfikowałem):

    <script>
    jQuery(function($){
    
        var menu = $('.main-nav');
    menu.addClass('default');
    
            pos = menu.offset();
    
            $(window).scroll(function(){
                if($(this).scrollTop() > pos.top+menu.height() && menu.hasClass('default')){
                    menu.fadeOut('fast', function(){
                        $(this).removeClass('default').addClass('fixed').fadeIn('fast');
                    });
                } else if($(this).scrollTop() <= pos.top && menu.hasClass('fixed')){
                    menu.fadeOut('fast', function(){
                        $(this).removeClass('fixed').addClass('default').fadeIn('fast');
                    });
                }
            });
    
    });
    </script>
    Thread Starter kinga2801

    (@kinga2801)

    Dziękuje bardzo! Działa jak należy!:)a jest taka możliwośc żeby to działało w wersji mobilnej?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Temat ‘statyczne menu- problem’ jest zamknięty na nowe odpowiedzi.