Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1247523
    acritch
    Participant

    Hello,

    A few months ago I had asked about a fixed sidebar using the Integrity stack and someone gave me a piece of code that worked great at the time:

    .x-sidebar.right {
        position: fixed;
        right: 100px;
    }

    That was until I added a slider to the page. Once I did that the side menu moved way down the page so it was not usable (see screen shot). I have since removed that piece of code and the menu has moved back up directly under the slider. My question now is, how do I get it to stick there so it doesn’t scroll when the page does?

    I am using X v4.6.4, Cornerstone V1.3.3, and WP 4.6.1. Credentials and problem page in the next post.

    Additional question – I had used this method because I wanted a secondary form of navigation to navigate around the long page. Would Uber Menu be able to provide something similar that is easier to create and maintain? I know it has a TON of capabilities but it has been too intimidating for me to look into yet.

    #1247525
    acritch
    Participant
    This reply has been marked as private.
    #1248070
    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery(document).ready(function($){
    	var slider = $('.x-slider-container.below').height() + 40;
    	$(window).scroll(function(){
    		if ($(this).scrollTop() > slider) {
    			$('aside.x-sidebar.right > div').css({"position": "fixed", "top": "130px", "right": "50px", "width": "25%"});
    		} else {
    			$('aside.x-sidebar.right > div').css({"position": "relative", "top": "auto", "right": "auto", "width": "auto"});
    		}
    	});
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1248498
    acritch
    Participant

    That works great!! Thank you!

    #1248502
    Jade
    Moderator

    You’re most welcome.

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