【发布时间】:2016-01-17 19:47:55
【问题描述】:
我从未使用过 fullpage.js。我尝试了很多滑块过渡效果。滚动效果很好。它通过滚动从左到右移动,但无法添加淡入淡出效果。
示例网站:http://www.mi.com/shouhuan/#clock 我的代码:http://jewel-mahmud.com/demo-site/index.html
var slideIndex = 1,
sliding = false;
$(document).ready(function() {
$('#fullpage').fullpage({
sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', 'whitesmoke', '#ccddff'],
scrollingSpeed:1000,
css3: true,
onLeave: function(index, nextIndex, direction) {
if(index == 2 && !sliding) {
if(direction == 'down' && slideIndex < 3) {
sliding = true;
$.fn.fullpage.moveSlideRight();
slideIndex++;
return false;
} else if(direction == 'up' && slideIndex > 1) {
sliding = true;
$.fn.fullpage.moveSlideLeft();
slideIndex--;
return false;
}
} else if(sliding) {
return false;
}
},
afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex) {
sliding = false;
}
});
});
【问题讨论】:
-
这可以通过使用fullpage.js extension Fading Effect来实现。
标签: javascript jquery slider fadein fullpage.js