Share Posted June 24, 2016 Hi everyone, I recreated a codepen that replicate more or less my problem (for using that click somewhere in the white area)I'm trying to achieve something like the one you can see. I need to open a "fixed popup" that everytime change it's initial position. If you try the pen everything works fine for the only first click but if you try to click again you can see that the "modal" still opening from the position you clicked the first time. Can anyone explain whats is going on? ps: I added a delay so you can see clearly what's is going on. Thanks eveyone! See the Pen LZxLzR by anon (@anon) on CodePen Link to comment Share on other sites More sharing options...
Share Posted June 25, 2016 Thanks for the demo. I think the problem is that you are creating a timeline once and replaying that same timeline over and over. Keep in mind that starting and ending values in every tween in a timeline are recorded and re-used on each play. In this case I think you want a fresh timeline each time. Sort of like: http://codepen.io/GreenSock/pen/rLjzoG?editors=1010 1 Link to comment Share on other sites More sharing options...
Author Share Posted June 28, 2016 So essentially I should declare every click the timeline, otherwise it takes the original values of when I declared it. Am i right? Thanks for the demo. I think the problem is that you are creating a timeline once and replaying that same timeline over and over. Keep in mind that starting and ending values in every tween in a timeline are recorded and re-used on each play. In this case I think you want a fresh timeline each time. Sort of like: See the Pen rLjzoG?editors=1010 by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now