Sticky sidebar

Sticky Sidebar is a pure JavaScript plugin for making smart and high performance sticky sidebar, works with sidebar if it’s taller or shorter than the viewport, integrated with resize sensor to re-calculate the dimensions automatically when the size of sidebar or its container is changed.

Plugin homepage

<div class="row">
    <div class="col-8">main content here</div>
    <div class="col-4">
        <div class="sticky-sidebar">sidebar content goes here</div>
    </div>
</div>