jQuery-headerPersist

Locks a header to the top of the page only when user is scrolling within it's parent container.

View the Project on GitHub travishorn/jquery-headerPersist

Description

Locks a header to the top of the page only when user is scrolling within it's parent container.

Open example.html for example usage.

Required HTML

<div class="persistMe">
  <h2>Header 1</h2>
  <p>Lorem ipsum dolor sit amet...</p>
</div>

Required JavaScript

$('.persistMe').headerPersist();

Links