There is a central content block and there is a right sidebar. It is necessary to slow down the scrolling of the right sidebar by the amount of the difference in their heights. The scrolling of both blocks should end in the same place, "coming to the finish" at the same time
$(document).ready(function(){ var content_height = $('.content').height(); // получаем высоту контента var sidebar_height = $('.sidebar').height(); // получаем высоту сайдбара var slow_ratio = Math.round(parseInt(content_height)/parseInt(sidebar_height)); //рассчитываем коэффициент замедления if(slow_ratio > 1){ // если разница больше 1, то нужно замедлить прокрутку $('.sidebar') в slow_ratio раз, то есть оба блока должны "приходить к финишу" одновременно, так сказать } });