Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by Cefn

  1. In practice I'm calling quite a few tweens and hoping to be able to have a single point in the timeline as a place I can tween back to, regardless of what the last tween happened to be.


    It could be the only way to do this is manually store all the relevant CSS through JQuery data(...), but this seems like a bit of a nightmare. I'm guessing that reversing a from(...) will only reverse the attributes which that from(...) tween was actively manipulating, and if other tweens have run in the meantime, they won't be reversed.


    As it turns out the place I want to revert to is the same place the elements were when the page was loaded if that helps simplify the problem at all.

  2. So in conclusion, the least worst approach seems to be to rely on JQuery's css methods, but then override its junked "width" value with a known assignment, as suggested by this codepen which works fairly well.


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


    Ideally it would be possible to also revert to the original values without having to manage this information explicitly. Is there a reliable strategy in Greensock to get back to initial values?

  3. OK, my stupid. There could be an initial problem to do with the fact that changing individual cells to absolute positioning could affect the position of other cells (because they no longer take up the same space in the layout). If that's true I may need to do a caching run (storing positions) followed by a positioning run (setting positions).


    The updated version of the Codepen takes account of this, and yet is still doing junk positioning owing to a bug in JQuery width() when applied to table cells I think.


    The following codepen includes a workaround, ignores JQuery's width, and substitutes a hard-coded value, and finally works, but in a roundabout fashion.


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

  4. @Greensock thanks for the suggestion. I don't know how transforms would help me exactly, as I need to tween from its current location to a target location relative to the viewport, and I don't know how a transform's coordinate system could help me achieve this (especially given that I can't seem to work out where the element actually is to begin with).

  5. I'd like to have some table cells animate from their automatically laid out relative position, to certain designated absolute positions to highlight them, and then have them return to their position in the table.


    In particular I have a Gantt chart with three selectable cells which I would like to tween from its initial...


    to a temporary...


    ...and then tween them back to their initial relative values again.


    Is there a Greensock way of doing this?


    If I use a regular to(...) tween with the values above, the 'position' value is toggled monolithically to 'absolute', with the top and left set to 0 so the cells jump to the top left corner immediately, then tween their location and width from there, rather than tweening smoothly from their initial (relative) location.


    There's probably a workaround, involving JQuery calculating the starting positions for the tween from the rendering engine, but perhaps someone has an elegant way of doing this, as I'm sure I'm not the only one who needs the behaviour.

  6. Thanks for all your contributions.


    Yeah, I should have noticed the incorrect TimelineLite reference as I'd recognised before that yoyo was TimelineMax only.


    The approach of tweening my own object properties with onUpdate is quite elegant. 


    However, I believe that for consistency with other degree oriented values (the hue in HSL varies from 0 to 360 degrees), it would be worth looking into wiring HSL to the DirectionalRotation plugin by default as described at http://www.greensock.com/gsap-js-1-9-0/ making it possible to use degrees consistently wherever they appear.

  7. Hi all. GSAP is a great framework, really enjoying using it. However I'm struggling to get Hue tweening using HSL within the Color plugin (via CSS automatic binding).


    A terse attempt to set a background box which tweens its color slowly through the color wheel is as below, but no change seems to happen. 


    If I remove the 'set' line, then there are some tweened changes to color, (visible in real time within Chrome when the element is selected) but they don't seem to visit the whole 360 degrees of the color wheel. Can anyone help tell me how this is meant to be specified or is a bug/missing feature with respect to degrees in HSL?


    For now I have the following kludge in place, but I don't like it much as I think something like the simpler syntax should work...

    var washTl = new TimelineLite();
    washTl.yoyo = true;
    washTl.repeat = -1;