本文介绍了scrollify-在上一节之后正常滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
scrollify插件能否在上一节之后正常滚动?例如,我有6个部分,然后有一个页脚,我想在最后一个部分之后滚动是正常的.现在,因为页脚不是一个部分,所以我什至无法滚动到它.
Is it possible with the scrollify plugin to scroll normally after last section? For example I have 6 sections and then a footer, I want scrolling after the last section to be normal. Right now, because footer isn't a section, I can't even scroll to it.
推荐答案
当视口位于最后一张幻灯片的下方时,我禁用了scrollify,否则启用了它:
I disable scrollify when viewport is below of last slide and enable it in otherwise:
$(document).on('scroll', function(e){
var top = $('.slider .slide:last').offset().top;
var screenTop = $(document).scrollTop();
if (top > screenTop && $.scrollify.isDisabled()) {
$.scrollify.enable();
$.scrollify.update();
} else if (top < screenTop && !$.scrollify.isDisabled()) {
$.scrollify.disable();
}
});
这篇关于scrollify-在上一节之后正常滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!