Make current h1/h2 sticky with Javascript : <p>I'd like to make a long website with lots of text more convinient by making the h1 or h2 element that would have just gone out of view (when scrolling down) sticky at the top until the next headline is about to go out of view and become sticky.</p>

<p>I believe I've seen this on some websites, but I don't know how to call it and can't find an example.</p>

<p>I'm using Bootstrap and JQuery, so a solution that works with either of them would be perfect.</p>
