Jump to content
Search Community

DanTheProgrammerMan

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by DanTheProgrammerMan

  1. Hello,

     

    I am trying to animate using rem units and am encountering unexpected behavior. In short, I'm doing this tween:

     

        TweenLite.to("#blue-circle-1", 1.2, {
          delay: 0.2,
          left: '-1rem',
          top: '4rem',
          ease: Elastic.easeOut
        });
     
    But the blue circle actually ends up at top:0px, left:0px instead of the expected left: -1rem, top: 4rem. This is demonstrated in the codepen . Interestingly, if I run the same exact Tween again, after the first failed Tween, it will go to the proper position.
     
    In addition, when trying to do the same thing with EM units, as seen at this codepen

    See the Pen zGwvPd by anon (@anon) on CodePen

    ,
    we see that the element does reach the correct position of  left: -1rem, top: 4rem, but the animation itself is not fluid, it looks like it has teleported. 
     
    And finally, the same animation works perfectly using the jquery animate function, doing what I'd expect it to do. See at this codepen:

    See the Pen bdWVKN by anon (@anon) on CodePen

     
    Can anyone explain why this is happening, or is this a bug?
     
    Thanks!

    See the Pen mJmeMa by anon (@anon) on CodePen

×
×
  • Create New...