jquery-color icon indicating copy to clipboard operation
jquery-color copied to clipboard

invalid now and tween.now values on animate step callback

Open danielocdh opened this issue 9 years ago • 2 comments

I was a bit surprised I couldn't find the issue anywhere, sample here: https://jsfiddle.net/apcso9gw/

danielocdh avatar Aug 20 '15 18:08 danielocdh

Seems legit.

ryanneufeld avatar Dec 06 '15 19:12 ryanneufeld

step is called before the property set hook is called.

https://github.com/jquery/jquery/blob/dbc4608ed10bd1347649e6f1514f459957cda003/src/effects/Tween.js#L37-L43

Try using progress instead which is called after, and guarnteed to be once per element per frame instead of once per property per element per frame, though since https://github.com/jquery/jquery-color/blob/889d029633ca9df371cb1dcca04d2513463b61c5/jquery.color.js#L620-L627 doesn't update the tween.now it will still be this invalid thing.

We could update the tween.now or possibly use a custom tween in newer versions of jQuery - this hasn't been updated since jQuery 1.8 put in the new tween hooks.

gnarf avatar Jan 14 '16 19:01 gnarf