我正在尝试为我的动画创建偏移量,因此它们在 pin 帧位于顶部之前开始,甚至在新部分进入视口时立即开始动画。
我已经尝试将偏移量放在附加动画的末尾,但这不起作用......
有任何想法吗?
var controller = $.superscrollorama({
triggerAtCenter: true
});
// set duration, in pixels scrolled, for pinned element
var pinDur = 6500;
// create animation timeline for pinned element
var pinAnimations = new TimelineLite();
pinAnimations
.append([
TweenMax.to($('#logo'), .5, {css:{left:'34%'}}),
TweenMax.to($('#left, #left2'), .5, {css:{top:'-1055px'}}),
TweenMax.to($('#right, #right2'), .5, {css:{top:'-1327px'}})
])
.append([
TweenMax.to($('#flash'), .01, {css:{display: 'none'}})
])
.append([
TweenMax.to($('#flash'), .02, {css:{display: 'block'}}),
TweenMax.to($('#logo, #left, #right'), .01, {css:{display:'none'}}),
TweenMax.to($('#flash, #frame, #stand, #wrapper'), .02, {css:{backgroundColor:'white'}}),
TweenMax.to($('#flash'), .02, {css:{display:'none'}})
])
.append(TweenMax.to($('#this_pin-frame-unpin'), .5, {css:{top:'100px'}}));
// pin element, use onPin and onUnpin to adjust the height of the element
controller.pin($('#wrapper'), pinDur, {
anim:pinAnimations,
onPin: function() {
$('#heelwrapper').css('height','100%');
},
onUnpin: function() {
$('#wrapper').stop().animate({height: '900px'}, 10);
}
});