有没有办法让用户滚动到某个点,元素淡入,然后播放动画(X2)(无需用户输入),然后滚动触发进一步的动画,但只有在动画时才能触发(X2) 已播放完毕。
var controller = $.superscrollorama({
triggerAtCenter: false
});
// set duration, in pixels scrolled, for pinned element
var pinDur = 2800;
// create animation timeline for pinned element
var pinAnimations = new TimelineLite();
pinAnimations
.append([
TweenMax.to($('#mouse_walk'), 5, {css:{opacity: 1},
onComplete: function(){
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '977px', width: '1080px', left: '49.5%', top:'370px'}, 200, function(){
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '944px', width: '1044px', left: '50%', top:'380px'}, 200, function(){
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '995px', width: '1100px', left: '49.3%', top:'360px'}, 200, function(){
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '944px', width: '1044px', left: '50%', top:'380px'}, 200, function(){
setTimeout(function() {
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '977px', width: '1080px', left: '49.5%', top:'370px'}, 200, function(){
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '944px', width: '1044px', left: '50%', top:'380px'}, 200, function(){
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '995px', width: '1100px', left: '49.3%', top:'360px'}, 200, function(){
$( "#mouse_walk, #mouse_walk img" ).stop().animate( {height: '944px', width: '1044px', left: '50%', top:'380px'}, 200, function(){
})
})
})
})
}, 800);
})
})
})
});
}
}
)
])
.append([
TweenMax.to( $('#mouse_walk_hell'), 5, {css:{opacity: '1'}})
])