Tagged: x
-
AuthorPosts
-
June 15, 2016 at 11:31 am #1043522
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
June 15, 2016 at 11:32 am #1043523This reply has been marked as private.June 15, 2016 at 2:03 pm #1043785Hi 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!
June 16, 2016 at 3:48 am #1044822perfect, thanks 😉
June 16, 2016 at 4:21 am #1044872You’re welcome!
We’re glad we were able to help you out. -
AuthorPosts