Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

click and scroll fullpage.js

I use fullpage.js and I've a little problem, I've 3 buttons which are used to scroll on différents sections. My question is : How can I go on a specific page by using button, and which boutton can I use to ? (On fullpage.js)

like image 239
mathieu Avatar asked May 10 '26 02:05

mathieu


1 Answers

With Full page moveTo Function, you can depend on index of button in button group, like for example: HTML: Button Group:

<div class="buttons-group">
    <button class="ui button"></button>
    <button class="ui button"></button>
    <button class="ui button"></button>
</div>

JS:

$('.buttons-group').on('click',function() {
    $("#fullpage").fullpage.moveTo($(this).index() + 1);
});

where as for my fullpage sections look like this:

<div id="fullpage">
    <div class="section"></div>
    <div class="section"></div>
    <div class="section"></div>
</div>

or any similar methods, like depending on button id, and make the id contain section index number.

like image 99
Basel Issmail Avatar answered May 12 '26 17:05

Basel Issmail