Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Posts posted by vicmortelmans

  1. Hi, thanks for the fast feedback!


    I've tried to make a demo, but for some reason the scrollTo animation isn't doing anything in CodePen. I suspected the 'window' element to be the problem, but I replaced it by a wrapper div with fixed height without success... Still maybe it will better illustrate the purpose:


    See the Pen Zvedxv by vicmortelmans (@vicmortelmans) on CodePen


    Best regards,


  2. Hi,


    I have two animations that should run simultaneously: 


    1. reducing an element's height to 0
    2. 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,