Webflow和Fullpage.js相互干扰
Webflow and Fullpage.js interfering with each other
我目前正在用webflow设计的测试网站上使用fullpage.js插件。在我包含插件之前,一切都正常工作。现在,webflow的滚动交互已经不起作用了。
我认为这两个javascript文件有点相互干扰,限制了另一个的功能正常工作。我很想解决这个问题,但我真的不知道怎么解决。
这是一个没有包含fullpage.js的网站这个是包含fullpage.js的网站。正如你所看到的,在第一个例子中,段落在滚动时会淡入淡出。在第二个例子中,他们没有。段落只是停留在它们的初始外观状态,即不透明度=0。我真的很想看到fullpage.js与webflow交互并肩工作。
_
这是html代码:
<body>
<div class="pagewrap">
<div class="section blue01">
<div class="w-container">
<p data-ix="scroll-fade-in"></p>
</div>
</div>
<div class="section blue02">
<div class="w-container">
<p data-ix="scroll-fade-in"></p>
</div>
</div>
<div class="section blue03">
<div class="w-container">
<p data-ix="scroll-fade-in"></p>
</div>
</div>
</div>
</body>
_
这是javascript代码:
<script type="text/javascript" src="js/webflow.js"></script>
<script type="text/javascript" src="js/jquery.fullPage.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.pagewrap').fullpage({
'verticalCentered': true,
'css3': true,
'navigation': true,
'navigationPosition': 'right',
});
});
</script>
_
这是CSS代码:
.section.table,
.slide.table {
display: table;
width: 100%;
}
.tableCell {
display: table-cell;
vertical-align: middle;
width: 100%;
height: 100%;
}
.easing {
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
.section {
height: 100vh;
}
.section.blue01 {
background-color: #3cb7e8;
}
.section.blue02 {
background-color: #3ccbe8;
}
.section.blue03 {
background-color: #3ce2e8;
}
html.w-mod-js.w-mod-no-ios *[data-ix="scroll-fade-in"] {
opacity: 0;
}
_
在这里,您可以找到包含的两个javascript文件:
jarocastenberg.de/x/help/01/js/webflow.js
jarocastenberg.de/x/help/01/js/jquery.fullPage.js
_
有没有人擅长javascript,能够发现这两个脚本在哪里冲突?
提前感谢!
Jaro
您可以在fullPage.js常见问题解答中找到答案:
jQuery滚动事件不起作用
与Parallax相同的答案不适用于fullpage.js
此外,请考虑使用fullpage.js提供的回调,如文档中详细介绍的afterLoad、onLeave、afterSlideLeave和onSlideLeaf,或添加到包含活动部分/幻灯片的body元素中的类
和:
Parallax不适用于fullpage.js。
简短回答:如果不想使用自动滚动功能,请使用fullPage.js的滚动条:true选项或autoScrolling:false。
解释:Parallax和许多其他依赖于网站滚动的插件都监听javascript的scrollTop属性。fullPage.js实际上并不滚动网站,但它更改了网站的top或translate3d属性。只有当使用fullPage.js选项scrollBar:true或autoScrolling:ffalse时,它才会以scrollTop属性可以访问的方式滚动网站。
如果你只是想让你的文本变淡或变淡,我会在页面更改时使用添加到正文中的CSS类。但是,可以随意使用回调,也可以与javascript或jQuery结合使用来创建效果。
我解决了如果使用FULLPAGE.JS,如何在WEBFLOWE中运行SCROLL动画。要滚动锚点,在刷新每个锚点后,按如下方式刷新滚动位置:
$(document).ready(function() {
$('#fullpage').fullpage({
anchors: ['01', '02', '03', '04', '05'],
animateAnchor: true,
easing: 'easeInOutCubic',
scrollingSpeed: 600,
scrollOverflow: true,
scrollOverflowReset: true,
//
afterLoad: function(origin, destination, direction){
var loadedSection = this;
//refresh scroll position
$.fn.fullpage.setAutoScrolling(false);
$.fn.fullpage.setAutoScrolling(true);
//
if(origin.anchor == '01'){
}
if(origin.anchor == '02'){
}
if(origin.anchor == '03'){
}
if(origin.anchor == '04'){
}
if(origin.anchor == '05'){
}
}
});
});
- 可以't让我的if语句处理js中的html表单输入
- 使用agility.js进行页面布局和合成
- 使用Clipboard.js复制span文本
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- 强制模板刷新ember.js
- 如何编写HTML输入的JS内联
- 多个单选按钮组相互干扰
- Angular JS IE9 Hashbang url rewriting
- 使用JS将数组转换为json对象
- Node.js v6.2.0类扩展不是函数错误
- 当js函数's已执行
- 如何通过JS在不干扰其标记的情况下更改HTML文档中字符串的所有实例
- Webflow和Fullpage.js相互干扰
- JS 函数名称干扰对象属性
- 防止JS干扰我的媒体特定样式表
- JS加载时的平滑滚动干扰点击时的平滑滚动
- Js注入干扰了我所有的代码
- 锤js -关闭菜单右滑-垂直滑动干扰
- Quicksand.js干扰引导模态
- angular js的UI-router会干扰$httpbackend单元测试