Jump to content
Search Community

maximus8891

Members
  • Posts

    4
  • Joined

  • Last visited

maximus8891's Achievements

0

Reputation

  1. Hi, I've tried using Modifiers Plugin with Draggable as follows: Draggable.create(".box", { type:"x", modifiers: { x: function(x) { return x % 500; } } }); It did not work. Is there any other way to override the x value before it is applied to the draggable element while dragging? Alternatively I was trying to find a way to initiate dragging on an element without applying the transforms to it. Thanks, Max
  2. I see that most issues are related to backwards compatibility and not confusing users. But I don't quite understand what you mean by the benefits of strict data typing. I look at the code in TweenLite.js: var Animation = _class("core.Animation", function(duration, vars) { this.vars = vars = vars || {}; this._duration = this._totalDuration = duration || 0; this._delay = Number(vars.delay) || 0; Type conversion is done for delay, but not for duration. I think there is as many reasons to do type conversion for duration as for vars.delay. Correct me if I'm wrong, but you can run TweenLite.to(elm, '3.545') and it will run totally fine, hurting performance. This may pass unnoticed in cases when duration is deducted from dom attributes, which are strings. I think the major problem about this param is that if a user likes to make a config and apply it he has to do it like this: var tween = { duration: 1, vars: { ease: ease } }; .... TweenLite.to(elm, tween.duration, tween.vars); // Instead of much cleaner TweenLite.to(elm, tween); I think I end up making a wrapper like function TweenLiteV2(config) { return TweenLite.to(config.elm, config.duration, config.tween); }
  3. Thank you for the response. Should it be a huge change to implement an alternative consistent approach: TweenLite.to(elm, {duration: 1}); leaving alone the traditional one. This will make code more concise too in certain cases.
  4. Is there a specific reason why duration is an argument but not a config object param? I'd really like to put duration of a tween into object as well. Instead of TweenLite.to(elm, 1, {delay: 10}); it could be TweenLite.to(elm, {duration: 1, delay: 10}); so I could do this var tween = { duration: 1, delay: 10 }; TweenLite.to(elm, tween); instead of var tween = { duration: 1, delay: 10 }; TweenLite.to(elm, tween['duration'], tween);
×
×
  • Create New...