I just want to know how to use the jquery .css() function to not overwrite, but to add additional values to css properties.
For instance, I have an element that is curre
Save the current style, then concatenate:
var rotation = 0;
function rotate() {
rotation += 90;
var rotationString = 'rotate(' + rotation + 'deg)';
var current = $('#square').css('transform');
$('#square').css('transform', current +' '+ rotationString);
}
http://jsfiddle.net/oqqubda8/
It works, and I don't know if there's another way to do it.