Skip to content

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

Open
AndClarke wants to merge 2 commits intoWickyNilliams:masterfrom
AndClarke:up-down-offset-options
Open

Added 'up' and 'down' values for offset option#297
AndClarke wants to merge 2 commits intoWickyNilliams:masterfrom
AndClarke:up-down-offset-options

Conversation

@AndClarke
Copy link

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.

}

if (currentScrollY <= this.offset ) {
if (currentScrollY <= this.offset['up'] ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndClarke shouldn't this be this.offset['down']?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants