alvarotrigo / alvarotrigo/fullPage.js

Change active anchor at custom scroll position

Aberta
#2,209 3 comentários 0 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
JavaScript
Estrelas
35.4k
Forks
7.1k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

### 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);`

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.