Okay
  Public Ticket #363035
Fixing the following sidebar
Closed

Comments

  • S started the conversation

    Hi there - this is an FYI for everyone using this amazing theme.

    If you want your sidebar to follow correctly, and responsively, then use this code (i recommend inserting it to the footer with the Custom css-php-js plugin)

    var p = jQuery.noConflict();

    sticky_div2();

    function sticky_div2() {

    if ( p('#sidebar-inner').length ) {

    var

    el = p('#sidebar-inner'),

    stickyTop2 = p('#sidebar-inner').offset().top,

    margin = p('#header-space').length ? p('#header-space').height() : 0;

    p(window).scroll(function(){

    var

    stickyHeight2 = p('#sidebar-inner').outerHeight(true),

    limit = p('#footer-outer').offset().top - stickyHeight2,

    windowTop = p(window).scrollTop();

    /*--- by top -----------------------------*/

    if ( stickyTop2 < windowTop + margin ) {

    el.css({ position: 'fixed', top: margin + 10});

    }

    else {

    el.css( 'position', 'static' );

    }

    /*--- by footer -----------------------------*/

    if ( limit < windowTop + margin) {

    var

    diff = limit - windowTop;

    el.css({ position: 'fixed', top: diff });

    }

    });

    }

    }

    YOU WILL ALSO NEED TO ADD THIS TO CUSTOM CSS: 

    #sidebar-inner {

    display:inline-block;

    }

    @media screen and (max-width:1000px) {

    #sidebar-inner {

    position: relative !important;

    top: 0px !important;

    }

    }

  •  988
    ThemeNectar replied

    Hey - thanks for posting your code! 

    Cheers