Hi,
I have two animations that should run simultaneously:
reducing an element's height to 0
scrolling to a certain position, to align a certain element to the top of the screen. Note that this element is *after* the element in animation 1
I've calculated the target position for scrolling based on the document *after* the first element's height is reduced to 0, and I also tried the animation with target position for scrolling based on the document *before* the element's height is reduced to 0, but somehow the proper position is never reached.
I have also tried to provide the scrolling animation with the id of the element that should align to the top of the screen, that doesn't work either.
When I delay the second animation until the first has finished, it is working.
How can both animations be achieve simultaneously?
Here's the code for my two animations (with the delay in the second animation, which I want to avoid):
TweenLite.to(contentToHide,1,{height:0}); // animation 1
TweenLite.to(window,1,{delay: 1, scrollTo:Math.max(0, scrollReference + scrollCorrection)}); // animation 2
Best regards,
Vic