rstacruz / jquery.transit

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

Cant get += and -= working? #123

Closed vartana closed 11 years ago

vartana commented 11 years ago

I currently have this fire when dragging and the move is not accumulated, it starts from the 0 over again.

function animate(){
var move = lastDiffY - diffY;

    console.log(move);

    var easeSpeed = 4;
    var easeType = "ease";

    var guestPhotos = $('#photos');
    guestPhotos.transition({y: '+='+(move)}, easeSpeed, easeType, function(){});

    ticking = false;
}
rstacruz commented 11 years ago

doing $('...').transition({ y: '+=10' }) will work. Try it on any page (like, say, this).

I'm guessing that calling .transition() in rapid succession (since you probably tried to do this on a drag handler). Try changing .transition to .css.