scrollOverflow在fullPage.js中不起作用 [英] scrollOverflow not working in fullPage.js

查看:2463
本文介绍了scrollOverflow在fullPage.js中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用fullPage.js作为项目,我无法弄清楚如何让溢出滚动工作。我页面中的最后一个部分运行时很长,因此需要垂直滚动。

I recently began using fullPage.js for a project, and I cannot figure out how to get the overflow scrolling to work. The last 'section' in my page runs long, and as such, needs vertical scrolling.

这是我在中的代码< 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验证。

I am also using Bootstrap (including the JS), as well as jQuery validate.

此处我还缺少其他任何可启用此功能的内容吗?

Is there anything else I'm missing here to enable this feature?

推荐答案


此处我还缺少其他任何内容来启用此功能吗?

Is there anything else I'm missing here to enable this feature?

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

If i understand it correctly, all you are missing out on is the option called normalScrollElements. It is a class/id you define and then add to the div element.

    $(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>

正如您所见,仍然需要应用sectionSelectorsection。

As you can see the sectionSelector "section" still needs to be applied.

这篇关于scrollOverflow在fullPage.js中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆