Comments S started the conversationJanuary 31, 2015 at 12:49amHi 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 ) {varel = p('#sidebar-inner'),stickyTop2 = p('#sidebar-inner').offset().top, margin = p('#header-space').length ? p('#header-space').height() : 0;p(window).scroll(function(){varstickyHeight2 = 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) {vardiff = 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;}} 1,075ThemeNectar repliedFebruary 3, 2015 at 6:45amHey - thanks for posting your code! Cheers Sign in to reply ...
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;
}
}
Hey - thanks for posting your code!
Cheers