Loading...
 

Hide Fixed Top Nav Bar on Scroll

Hide Fixed Top Nav Bar on Scroll (version 0.3c)

This hides the fixed navbar on top on page scroll.





YAML
instructions: Hidable Navigation Bar instructions
preferences:
 site_layout: fixed_top_modules
 feature_sitelogo: n
objects:
 -
  type: module
  data:
   name: Hide Fixed Top Nav Bar on Scroll (0.3c)
   position: bottom
   order: 1
   params:
    nobox: y
   custom: |
    {jq}{literal}
    $(document).ready(function () {
      var resetCSS = {
        transition: 'all .5s ease 0s',
        top: '',
        height: '',
        minHeight: '',
        opacity: '',
        overflow: ''
      };
      $(window).on("scroll", function () {
        if ($(window).scrollTop() > 200) {
          $('.navbar-fixed-top').css({
              transition: 'all .75s ease 0s',
              top: '-20px',
              height: '25px',
              minHeight: '5px',
              opacity: '.75',
              overflow: 'hidden'
          });
          $('html:not(#page_1) .topbar_wrapper').css({
              position: 'fixed',
              top: '7px',
              width: '100%',
              left: 0,
              'z-index': 3
          });
          $("html:not(#page_1) .topbar").css({
              "box-shadow": "0 5px 10px 0px rgba(0,0,0,.25)"
          });
        } else {
          $('.navbar-fixed-top').css(resetCSS);
          $(".topbar_wrapper").removeAttr('style');
          $(".topbar").removeAttr('style');
        }
      });
      $('.navbar-fixed-top').on('mouseover', function () {
        $(this).css(resetCSS);
        $('html:not(#page_1) .topbar_wrapper').css({
          top: '48px'
        });
      });
    });
    {/literal}{/jq}


Instructions page

YAML
objects:
  -
    type: wiki_page
    ref:  hidable_top_navbar_inst_page
    data:
      name: Hidable Navigation Bar instructions
      description: Some instructions about the profile Hide Fixed Top Nav Bar on Scroll
      lang: en
      content: wikicontent:Profile_hidable_top_navbar_instructions



Contributors to this page: Xavier de Pedro , Xavi (as xavidp - admin) , luciash d' being and Jonny Bradley .
Page last modified on Saturday 05 of August, 2017 15:41:39 UTC by Xavier de Pedro.
Category: 15.x
Category: 16.x
Category: 17.x