I'm currently working on a website and would love for you to check it out at .
My goal is to create a static sidebar, and I am using the following code:
$(function() {
var offset = $("#ad-wrapper").offset();
var topPadding = 60;
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
$("#ad-wrapper").stop().animate({
marginTop: $(window).scrollTop() - offset.top + topPadding
});
} else {
$("#ad-wrapper").stop().animate({
marginTop: 0
});
};
});
});
Although the sidebar appears as intended, it seems to extend into areas where it shouldn't be, such as the footer. Instead of overlapping the footer, I want it to stay positioned next to the grid.
Any help or suggestions on how to achieve this would be greatly appreciated. Thank you in advance!