rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.3k stars 864 forks source link

Wrong property hash passed to .css function? #203

Closed atomictag closed 9 years ago

atomictag commented 10 years ago

After upgrading from 0.9.9 to 0.9.11 I had some transitions that started behaving weirdly.

Starting from 0.9.11 the original property hash passed to $.fn.transition is deep-cloned into theseProperties - which is then used to extract the parameters for the transition.

However, when transitions are applied the original properties hash is used instead of the deep-cloned and cleaned-up theseProperties hash. This seems wrong and can cause some nasty and unpredictable troubles if the alternate syntax is used (e.g. .transition({ y : 0, duration : 300, complete : function() { ... } }) ) since invalid key-values are passed to $.css.

https://github.com/rstacruz/jquery.transit/blob/master/jquery.transit.js#L662

...
  // Apply transitions.
  self.each(function() {
    if (i > 0) {
      this.style[support.transition] = transitionValue;
    }
    $(this).css(properties); // <--- this should be "theseProperties"
  });
...
rstacruz commented 10 years ago

Looks like a pretty big issue—let me look at it and see if I can try to write some test cases.

atomictag commented 9 years ago

This has been fixed in 0.9.12