2

Im using Fullpage.js and trying to make it work with wordpress, and its going forward. However, I'm trying to figure out how to be able to scroll trough a slide with content higher then the active slide. The plugin comes with a scroll overflow function, but that vill make a scrollbar that scrolls trough your content, and keeps going to the next slide.

Ideally a constant scrollbar that stops at the current slide would be the best option for me, but i dont know if this is possible.

Been fiddling with this for a while, so if anyone has any ideas how to solve this i would be thankful. My site:

http://www.svenssonsbild.se/Fullscreen/

Edit: Realize that what i want should be able to achieve by setting scrolloverflow: true in the plugins setting. Just didnt realize it didnt work for me.

So, if anyone hav any ideas why it wont work for me then it would be great. I suspect it have something with having the scripts hardcoded in the header and not enqueued, which i havent been able to figure out how to, since the supercontainer the script creates duplicates.

anyhow, any pointers will be very appriciated.

4

2 回答 2

7

我自己为此苦苦挣扎,然后再次阅读文档。这里说的是:

  • scrollOverflow:(默认为 false)定义是否为该部分创建滚动,以防其内容大于其高度。如果将其设置为 true,则需要供应商插件 jquery.slimscroll.min,并且应在fullPaje.js 插件之前加载。例如:
<script type="text/javascript" src="vendors/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="jquery.fullPage.js"></script>

不加载 SlimScroll.js 是这里的问题。

然后相应地设置您的 $.fn.fullpage({ }) 配置。

$('#fullpage').fullpage({
    scrollOverflow: true
});
于 2014-03-10T15:57:52.620 回答
1

只是为了添加一些可能对其他人有所帮助的信息,我一直在使用这两个插件(fullpage.js 和 slimscroll.js),但在移动设备上使用它时发现 slimscroll 存在问题(动量和滞后问题)。

如果内容太长,可以将 scrollOverflow 设置为 false 并将下一位添加到 afterSlideLoad 函数以获得本机滚动:

$('.slide .active').css('overflow-y','auto');

于 2015-01-21T10:29:09.607 回答