Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1188978
    gselway
    Participant

    Hi,

    Almost there.

    Nearly everything works as it should apart from the header and sub menu go from white to transparent and back to white as you scroll.

    Once the sub menu is open I don’t want the header or sub menu changing back to transparent.

    #1188993
    Rad
    Moderator

    Hi there,

    Please change this existing code

    jQuery(document).ready(function($){
      $('.home.x-navbar-fixed-top-active .x-navbar-wrap').css('height', 0);
      $('.home .x-navbar').css({'background-color': 'transparent', 'box-shadow': 'none', 'border-width' : 0});
      
      $(window).scroll(function(){
        if ($(this).scrollTop() > 200) {
          $('.home .x-navbar-fixed-top').css({'background-color': '#fff', 'box-shadow': '0 0.15em 0.35em 0 rgba(0,0,0,0.135);', 'border-width' : '1px'});
        } else {
          $('.home .x-navbar-fixed-top').css({'background-color': 'transparent', 'box-shadow': 'none', 'border-width' : 0});
        }
      });
    });

    to this

    jQuery(document).ready(function($){
      $('.home.x-navbar-fixed-top-active .x-navbar-wrap').css('height', 0);
      $('.home .x-navbar').css({'background-color': 'transparent', 'box-shadow': 'none', 'border-width' : 0});
      
      $(window).scroll(function(){
        if ($(this).scrollTop() > 200 || ( $(window).width() > 980 && $('.x-nav-wrap.mobile').hasClass('in') ) ) {
          $('.home .x-navbar-fixed-top').css({'background-color': '#fff', 'box-shadow': '0 0.15em 0.35em 0 rgba(0,0,0,0.135);', 'border-width' : '1px'});
        } else {
          $('.home .x-navbar-fixed-top').css({'background-color': 'transparent', 'box-shadow': 'none', 'border-width' : 0});
        }
      });
    });

    Hope this helps.

    #1189773
    gselway
    Participant

    Hi, that has not worked.

    I still have the same issue.

    #1189982
    Rad
    Moderator

    Hi there,

    I changed it to this.

    jQuery(document).ready(function($){
      $('.home.x-navbar-fixed-top-active .x-navbar-wrap').css('height', 0);
      $('.home .x-navbar').css({'background-color': 'transparent', 'box-shadow': 'none', 'border-width' : 0});
      
      $(window).scroll(function(){
        if ($(this).scrollTop() > 200 ||  $('.x-nav-wrap.mobile').hasClass('in') ) {
          $('.home .x-navbar-fixed-top').css({'background-color': '#fff', 'box-shadow': '0 0.15em 0.35em 0 rgba(0,0,0,0.135);', 'border-width' : '1px'});
        } else {
          $('.home .x-navbar-fixed-top').css({'background-color': 'transparent', 'box-shadow': 'none', 'border-width' : 0});
        }
      });
    });

    Cheers!

    #1190643
    gselway
    Participant

    This seems to have cracked it!

    Thank you soo much for your help (all of you!). 🙂

    #1190721
    Paul R
    Moderator

    You’re welcome! 🙂

  • <script> jQuery(function($){ $("#no-reply-1171710 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>