1

I managed to increment a variable in a not linear way using jQuery easing like this

var currentAngle = 0 
$(currentAngle).animate({ currentAngle: 180}, { // from 0 to 180 in 2sec
    duration: 2000,
    easing: 'easeOutBounce',
    complete: function(){
        movingarm = false;
        animatingArm = false;    
    }
});

I'm trying to do it without using Jquery now, pure javascript would be ideal. Any suggestions ?

Thanks

AlaricB
  • 366
  • 1
  • 3
  • 16
  • What do you mean by "variable"? Do you actually want to animate a CSS property? – Bergi Nov 20 '16 at 19:18
  • What's wrong with jQuery when it does the job? What have you tried to get rid of it? Did you look into the sources to see what your call does? – Bergi Nov 20 '16 at 19:18
  • i want to increment a javascript variable containing a numeric value. It's not for a css property. – AlaricB Nov 20 '16 at 19:20
  • What do you mean by "non-linear"? Do you want to use trigonometric trajectory or what? –  Nov 20 '16 at 19:20
  • @Bergi Me and my friends moved our app to angular and are currently trying to do without any jQuery. – AlaricB Nov 20 '16 at 19:22
  • 1
    @SoftwareEngineer171I want to use things like bezier curves or anything alowing to increment fast at start and slow at the end for exemple. – AlaricB Nov 20 '16 at 19:23
  • Yes, there are a lot of scripts that do this available on the web, sometimes wrapped nicely into libraries. Have you searched for them? What have you found? – Bergi Nov 20 '16 at 19:25
  • @Bergi Unfortunately didn't found any, maybe i am not using the correct keywors here. Do you have some examples ? – AlaricB Nov 20 '16 at 19:27
  • you could have a look here: http://stackoverflow.com/questions/38497765/pure-javascript-animation-easing/38498793#38498793 – Nina Scholz Nov 20 '16 at 19:28
  • @AlaricB [javascript easing](https://www.google.de/search?q=javascript+easing) gets me some good hits – Bergi Nov 20 '16 at 19:31
  • @NinaScholz Thx, at first sight it may do the trick ! – AlaricB Nov 20 '16 at 19:32
  • @Bergi Thx, i remember thoses, just didn't understood how i could use thems, but with NinaScholz link i may have understood how to. – AlaricB Nov 20 '16 at 19:34

0 Answers0