Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1285958
    raumfish
    Participant

    hi,
    you recommended to use the plugin (https://wordpress.org/plugins/sticky-element/)with .x-sidebar as the sticky element and .x-colophon.bottom as ‘sticky end’. (treat #624798)

    this works fine, but is there a predefined element (instread of ‘.x-colophon.bottom’) to use as sticky end to stop the sidebar at the sidebar bottom?

    thanks for help.
    flo.

    #1286033
    Christian
    Moderator

    Hey there,

    Plugins suggested in our replies are not recommendations and we don’t have support for them. Please contact the plugin author or you might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/

    Thanks.

    #1286159
    raumfish
    Participant

    o.k.
    do you have an idea, how to fix sidebar on its bottom, without plugin.
    i already tried this code, you posted on another thread (#184732):

    Custom > CSS in the Customizer

    @media screen and (min-width:979px){
    .fixedsidebar {
        position: fixed;
        top: 2.5%;
        right: 17.89%;
        width: 18%;
    }
    }

    and Custom > JavaScript

    $(window).on('scroll', function(){
        var sidebar = $('aside.x-sidebar.right');
        if ( $( this ).scrollTop() >= $(sidebar).offset().top
     - 20 ) {
    console.log('fixed attached');
          $( sidebar ).addClass('fixedsidebar');
        } else {
          $( sidebar ).removeClass('fixedsidebar');
        }
    console.log('scrolled');
    });
    
    $(window).trigger('scroll');
    
    });

    on the one hand, it works not very well, would you please have a look: http://neuland.ej-muenchen.de/region-sued/
    and on the other hand, the sidebar sticks on its top, not on its bottom.

    could you please help. thanks very much.
    flo.

    #1286196
    Rupok
    Member

    Hi there,

    Let’s update the JavaScript code to following :

    jQuery(document).ready(function($) {
      $(window).scroll(function() {
        var scrollPos = $(window).scrollTop(),
            navbar = $('.x-sidebar');
    
        if (scrollPos > 300) {
          navbar.addClass('fixedsidebar');
        } else {
          navbar.removeClass('fixedsidebar');
        }
      });
    });

    Hope this helps.

    #1286207
    raumfish
    Participant

    thank a lot. it also doesn’t work well , but it’s no plroblem. i decided to use a plugin yet, cause i have to come to a result.
    Anyway, thanks for the support.

    #1286256
    Rupok
    Member

    You are welcome!

    Feel free to let us know if you face any other issue. We’ll be happy to assist you.

    Cheers!

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