Fullpage.js: Next and Previous buttons

前端 未结 1 501
情深已故
情深已故 2021-02-15 05:40

I have two buttons: #btn1 and #btn2; and I want them to go back and forth when clicked. So #btn1 must go to previous slide and when I clic

相关标签:
1条回答
  • 2021-02-15 06:09

    Just add this:

    $('#button1Id').click(function(){
        $.fn.fullpage.moveSectionDown();
    });
    
    
    $('#button2Id').click(function(){
        $.fn.fullpage.moveSectionUp();
    });
    

    And better also to use the option fixedElements in case.

    $.fn.fullpage({
        fixedElements: '#button1Id, #button2Id'
    });
    


    UPDATE


    If you are using fullpage.js 2.X then you dont need to use the option fixedElements. Just using a wrapper for the plugin and placing the fixed elements outside the wrapper will work fine if you add the fixed positioned styling in your CSS.

    Example online

    0 讨论(0)
提交回复
热议问题