如何使用fullpage.js向下滚动每个部分

时间:2014-12-04 21:58:25

标签: javascript jquery fullpage.js

我指的是documentation,但它似乎并没有按照预期的方式运作。

我的代码:

 $('#moveDown').click(function(){
    $.fn.fullpage.moveSectionDown();
 });

我想要构建的是右下角的可点击固定元素,以便为用户向下导航每个部分。它似乎只能将$.fn.fullpage.setAutoScrolling(true);设置为true并将continuousVertical:true设置为true,除非我向上滚动然后单击#moveDown,否则它不会移动。有帮助吗?

修改

  <link rel="stylesheet" type="text/css" href="css/jquery.fullPage.css" />
  <script>
   //initialize fullpage scrolling
   $(document).ready(function(){
    $('#fullpage').fullpage({
    //Navigation
    menu: false,
    anchors: ['Home', 'Anonymous', 'Real Reviews', 'More', 'The App', 'Who'],
            autoScrolling:false,

    //Accessibility
    keyboardScrolling: true,

    //Design
    resize : false,

    });
    //remove styles and scripts related to fullPage for mobile
    if (screen.width < 479) {
        $.fn.fullpage.destroy('all');
        $("section, .section, div").removeClass("mid-text");
         }
    else{
        $.fn.fullpage.reBuild('all');
         }
    $('#moveDown').click(function(){
        $.fn.fullpage.moveSectionDown();

        });

    });
    </script>

这就是我的整页代码的布局方式。我检查了我的错误但是我只是没有使用的文件。我删除了这些文件并清除了一些错误,但似乎无法找到问题。我唯一不能想到的是插件之间的冲突?

更新
在每个div与类部分之间我有<div style="clear:both"></div>这是问题所在。现在一切都很完美。

0 个答案:

没有答案
相关问题