rstacruz / jquery.transit

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

Relative rotation incorrect for sets of length greater than 1. #98

Open tiffon opened 11 years ago

tiffon commented 11 years ago

When applying a relative rotation to a jQuery set that has more than one item, the relative rotation applied to each item is not the correct value. Instead, the rotation applied is the relative value times the number of items.

For example: if there are two items in $set, then the following code will apply a '+=50deg' rotation:

$set.transit({rotate: '+=25deg'})

But, this code will work correctly:

$set.each(function() {
    $(this).transit({rotate: '+=25deg'});
});

The jQuery css equivalent will apply only a 25 degree rotation:

$set.css({rotate: '+=25deg'});

Here is a jsFiddle demo: http://jsfiddle.net/KfhqU/