通过“旋转到“+180 度”,我假设您想以 360 为模将当前旋转增加 180 度?
由于您已经在使用 jQuery,请尝试以下操作:
var self = $(this);
var currentRotation = self.css('rotate').match(/([-.\d]+)deg/)[1];
var newRotation = (parseInt(currentRotation, 10) + 180) % 360;
self.css('rotate', newRotation + 'deg');