添加特殊类名达到动画效果
$(document).ready(function() {
$('#fullpage').fullpage({
sectionsColor: ["#fadd67", "#84a2d4", "#ef674d", "#ffeedd", "#d04759", "#84d9ed", "#8ac060"],
verticalCentered: false,
navigation: true,
scrollingSpeed: 1000,
afterLoad:function (link,index) {
$('.section').eq(index-1).addClass('action');
if(index == 2){
setTimeout(function(){
$('.w02').hide(2000)
},6000)
}
},
onLeave:function (index,nextIndex,direction) {
var currentSection = $('.section').eq(index-1);
if(index == 2 && nextIndex == 3){
currentSection.addClass('leaved');
}
}
});
实例:在进入screen03时特换图片闪动动画
#screen03 .content .cart img:last-child{
opacity: 0;
}
#screen03.action .cart img:first-child{
display: none;
}
#screen03.action .cart img:last-child{
opacity: 1;
transition: opacity 1s;
}