Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1043522

    drmodiho
    Participant

    Hello,

    my navbar appears when scrolling down. However the transition is not that smooth (it stagnates a bit). As well I want it to appear earlier.

    Hope you can help me with that issue.

    Thanks in advance,

    Moritz

    #1043523

    drmodiho
    Participant
    This reply has been marked as private.
    #1043785

    Rupok
    Member

    Hi there,

    Thanks for writing in! Let’s replace your JS code from Custom > JavaScript in the Customizer to following :

    
    jQuery('.expandall_accord').on('click', function(){
    jQuery('.x-accordion-body').collapse('show');
    });
    
    jQuery('.collapseall_accord').on('click', function(){
    jQuery('.x-accordion-body').collapse('hide');
    });
    
    jQuery(document).ready(function($) {
    
    setTimeout ( function() { //Late binding
    $('.wpsm_nav-tabs a').off('touchstart touchend').click(function(e) {
    $('html, body').stop();
    });
    }, 0 );
    
    });
    
    jQuery ( document ).ready( function( $ ) {
    
    $('.x-text > .x-nav a').on( 'click', function() {
    
    setTimeout ( function() {
    
    $( '.x-text > .x-tab-content > .x-tab-pane.active .x-nav-tabs-item.active a' ).click();
    
    }, 0 );
    
    } );
    
    } );
    
    jQuery(document).ready(function($) {
    
     $(window).scroll(function() {
    
        if ($(this).scrollTop()>100)
         {
            $('.rev-scroll-btn, .rev-btn.intro-button, .company-name, .company-subtitel, .banner-seperator, .banner-seperator-icon').fadeOut("slow");
         }
        else
         {
          $('.rev-scroll-btn, .rev-btn.intro-button, .company-name, .company-subtitel, .banner-seperator, .banner-seperator-icon').fadeIn();
         }
     });
     });
    
    jQuery(document).ready(function($){
    $('a.entry-thumb').attr('title','');
    });
    
    jQuery ( function( $ ) {
    
    $('.x-feature-box-text a:last-child').each( function() {
    
    $( this ).parent().parent().parent().find('.x-feature-box-graphic-inner i').wrap( '<a href="' + $( this ).attr('href') + '"></a>' );
    $( this ).remove();
    
    } );
    
     } );
    
    //disappearing navbar
    
    jQuery(function($) {
    
      var $body   = $('body');
      var $navbar = $('.x-navbar');
    
      if ( $body.hasClass('home') && $body.hasClass('x-navbar-fixed-top-active') && $navbar.length > 0 ) {
    
        var boxedClasses = '';
    
        if ( $body.hasClass('x-boxed-layout-active') ) {
          boxedClasses = ' x-container max width';
        }
    
        $(window).scroll(function() {
          console.log(navbarOffset());
    
          if ( $(this).scrollTop() >= navbarOffset() - 400 ) {
            $navbar.addClass('x-navbar-visible' + boxedClasses);
          } else {
            $navbar.removeClass('x-navbar-visible' + boxedClasses);
          }
    
        });
    
      }
    
      function navbarOffset() {
        return $('.x-slider-container.below').outerHeight() / 2;
      }
    
    });

    I have just updated

    if ( $(this).scrollTop() >= navbarOffset() )

    to

    if ( $(this).scrollTop() >= navbarOffset() - 400 )

    That means the Navbar will appear 400px earlier. So you can try changing the value 400 to your own value.

    Cheers!

    #1044822

    drmodiho
    Participant

    perfect, thanks 😉

    #1044872

    Rue Nel
    Moderator

    You’re welcome!
    We’re glad we were able to help you out.