I am currently working on a sticky sidebar that catches and stays fixed at a certain scroll point using JavaScript. However, I am facing an issue where I need the sidebar to catch when scrolling back up and not go further than its initial starting point.
$(window).scroll(function(e){
$el = $('.why_social');
if ($(this).scrollTop() > 735 && $el.css('position') != 'fixed'){
$('.why_social').css({'position': 'fixed', 'top': '-62px'});
}
});