alvarotrigo / alvarotrigo/fullPage.js
Change active anchor at custom scroll position
- 主要語言
- JavaScript
- 星號
- 35.4k
- 分支
- 7.1k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
### Description
I want to change active anchor when I scrolled exactly to the top of next section, not to middle of current section.
### Steps to reproduce it
1. Switch to mobile view on this [example](http://alvarotrigo.com/fullPage/examples/responsive.html#firstPage)
2. You can see that anchor "Second slide" change class to "active" when green section scrolled just to middle of the screen. http://take.ms/ev6ui
### How to fix
We can add new option, like `scrollRatio` . Anchor should change class to "active" when page scrolled to the top of next section (`scrollRatio: 0`). Default would be `scrollRatio: .5`.
**We can change this code**
`var screen_mid = currentScroll + ($window.height() / 2.0);`
**to**
`var screen_mid = currentScroll + ($window.height() * options.scrollRatio);`
貢獻指南
評估
這個 Issue 還沒有評估資料。