fullpage.js

Fullpage.js wont scroll up after clicking on link href


Im using the lastest version of fullpage.js(4.0.10).

I cannot suceed to put it on jsfidle license error block me to use CDN so I put a really simple part of code here give a copy past it locally will reproduce the problem(and of course link back the fullpage.js and the fullpage.css).

so everything work fine until i click to the "button>a href=here" to go to the slide #here

then I can't scroll up at all I have to scroll all the way down and scroll one more time down to then be able to scroll up upper than the slide id "#here"

I want to be able to after I fire a link to an id element to scroll up.

<button type="button"><a href="#here">here</a></button>
<h1>fullPage.js</h1></div>
  <div class="section" id="section1">
    <div class="slide" id="here"><h1>Simple Demo</h1></div>
    <div class="slide"><h1>Only text</h1></div>
    <div class="slide"><h1>And text</h1></div>
    <div class="slide"><h1>And more text</h1></div>
  </div>
  <div class="section" id="section2">
    <h1>No wraps, no extra markup</h1>
  </div>
  <div class="section" id="section3">
    <h1>Just the simplest demo ever</h1>
  </div>
</div>

code to run locally


Solution

  • The question has been answered here.

    I paste:

    You can use the anchors option to assign a different anchor to each section:

    new fullpage('#fullpage', {
        anchors: ['one', 'two', 'here', 'four'],
        
            //your other options...
    });
    

    This way the #here anchor will be linked to the 3rd section. https://jsfiddle.net/g26adykw/

    The other option is just using the fullPage.js JS methods such as moveTo.

    You can read more about anchors on the fullPage.js docs.