This is because first you go from 0 to a value of more than 3000. But then the value is always within 3000 - so the difference is not big enough, and it still takes 6 seconds that you determined.
One solution would be to make sure that you offset the value and change it every few thousand each time.
var i = 0, offset = [2000, 4000, 6000, 3000, 5000, 1000]; $('.bottle').on('click', function(e) { this.removeAttribute('style'); var deg = offset[i] + Math.round(Math.random() * 500); i++; if (i > 5) { i = 0; } var css = '-webkit-transform: rotate(' + deg + 'deg);'; this.setAttribute( 'style', css ); });
source share