Jump to content
Search Community

buttontobutton

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by buttontobutton

  1. This might not the right forum, but would appreciate any thoughts.

     

    In my codepen I am animating a div with an image in it. The issue is that I am animating my div left from 100% to -100%.

     

    However -100% is WAY longer than when the rightmost edge of the div is off of the screen, adding extra time. I essentially want it to end up at right: 100%.

     

    Is there a way using CSS to get it to stop at the equivalent of right: 100%, but while animating left?

     

    I was able to solve the issue by calculating the values dynamically on window.resize and killing and redeclaring the tween. Surely there has to be a better way?

     

    Thank you.

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

×
×
  • Create New...