Scrollbar on active slide for overflowing content with Fullpage.js

走远了吗. 提交于 2019-12-06 14:10:06
Xhezairi

I struggled with this myself, then went to read through the documentation again. Here what it states:

  • scrollOverflow: (default false) defines whether or not to create a scroll for the section in case its content is bigger than the height of it. In case of setting it to true, it requieres the vendor plugin jquery.slimscroll.min and it should be loaded before the fullPaje.js plugin. For example:
<script type="text/javascript" src="vendors/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="jquery.fullPage.js"></script>

Not loading SlimScroll.js was the issue here.

Then set your $.fn.fullpage({ }) config accordingly.

$('#fullpage').fullpage({
    scrollOverflow: true
});

Just to add a little info that mighht help out others, I've been using both plugins (fullpage.js and slimscroll.js) but found issues with slimscroll when using it on mobile devices (momentum and lag issues).

It is possible to set scrollOverflow to false and add this next bit to the afterSlideLoad function to get native scrolling if content is too long:

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!