2

我最近开始在一个项目中使用 fullPage.js,但我不知道如何让溢出滚动工作。我页面中的最后一个“部分”运行时间很长,因此需要垂直滚动。

这是我的<head>标签内的代码:

<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>      
    <script type="text/javascript" src="js/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="js/jquery.fullPage.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $.fn.fullpage({
                anchors: ['top', 'brand-or-agency', 'contact-us'],
                fixedElements: '#header',
                resize: false,
                scrollOverflow: true,
                css3: true,
                paddingTop: 100,
                loopTop: false
            });
        });
    </script>

我也在使用 Bootstrap(包括 JS),以及 jQuery 验证。

我在这里还缺少什么来启用此功能吗?

4

1 回答 1

-1

我在这里还缺少什么来启用此功能吗?

如果我理解正确,那么您所错过的只是名为normalScrollElements的选项。它是您定义然后添加到 div 元素的类/ID。

    $(document).ready(function(){
        $.fn.fullpage({
            anchors: ['top', 'brand-or-agency', 'contact-us'],
            fixedElements: '#header',
            resize: false,
            scrollOverflow: true,
            css3: true,
            paddingTop: 100,
            loopTop: false,
            normalScrollElements: '#element, .element'

        });
    });

HTML

<div class='section element'> This section will scroll vertically </div>

如您所见,仍需要应用sectionSelector“部分”。

于 2015-02-20T11:22:52.883 回答