headroom.js icon indicating copy to clipboard operation
headroom.js copied to clipboard

Added 'up' and 'down' values for offset option

Open AndClarke opened this issue 7 years ago • 0 comments

This very simple update makes offset more powerful. Use case:

  1. You want scroll up to always pin the navigation.
  2. You want scroll down to leave the navigation alone until the navigation is above the fold.

offset = 0 accomplishes (1) but not (2). offset = NAV_HEIGHT accomplishes (2) but not (1).

With this update you can set offset = {'up': 0, 'down': NAV_HEIGHT} to accomplish both.

AndClarke avatar Feb 21 '18 01:02 AndClarke