Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #47116

    Christian
    Moderator

    Hey Andrea,

    The Visibility shortcode is only for content and cannot be used on other website structures.

    Thanks.

    #63103

    HLFH
    Participant

    Hi,

    What is the code now ? The last JS+CSS given code does not seem to work on https://www.iraiser.eu/

    For example on https://www.iraiser.eu/apps/personal-fundraising-pages/.

    Thanks in advance,

    #63547

    Zeshan
    Member

    Hi Gaspard,

    Thank you for writing in!

    Instead of the old JS+CSS code, please add the following code:

    CSS Code (Customizer > Custom > CSS):

    @media (min-width:980px) {
    .x-sidebar.right {
    position: relative;
    }
    .widget.fix_my_position {
    position: fixed;
    width: 20%;
    }
    }
    

    JavaScript Code (Customizer > Custom > JavaScript):

    jQuery(function($){
    		$(window).scroll(function(){			
    			if( $(this).scrollTop() >= $('.x-main').offset().top ) {				
    				$('.x-sidebar .widget').addClass('fix_my_position').css({ top:$('.x-navbar').height() });
    			} 
    			else {
    				$('.x-sidebar .widget').removeClass('fix_my_position');
    			}
    		})
    });
    

    Hope this helps. Please let us know if you face any issue, we will be happy to assist.

    Thank you

    #885536

    PlanitLegal
    Participant

    Hi,

    I have a custom menu and another widget in the sidebar. I tried the latest code as given above (CSS+Javascript) to fix the sidebar at the top. It did not quite work for two reasons:

    1) the sidebar starts to move down a bit when scrolling and only then starts to stick to the top
    2) the widgets are drawn on top of each other (i.e. the widget above the menu)

    Is there a newer version of the code?

    Kind regards

    Bernhard

    #886435

    Rue Nel
    Moderator

    Hello Bernhard,

    Thanks for updating this thread! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

    Thank you.

    #988854

    Super Rainbow
    Participant

    Hi

    I have added the code into my css and Java but it doesn’t seem to work. Can you help?

    My site is goodbyethunder.com

    #989087

    Rupok
    Member

    Hi @super-rainbow

    Make sure to use the update code (#post-63547).

    Thanks

    #989453

    Super Rainbow
    Participant

    Thanks for your help Rupok. It worked perfectly. =)

    #989473

    Paul R
    Moderator

    You’re welcome! 🙂