How can I rotate an object by x degree and not to x degree.
I know transform/-webkit-transform
rotate an object by x degree, but I want something that will rotate my object from whichever angle it is in by x degree.
Kindly help.
How can I rotate an object by x degree and not to x degree.
I know transform/-webkit-transform
rotate an object by x degree, but I want something that will rotate my object from whichever angle it is in by x degree.
Kindly help.
So if i understand you well, what you want to achieve is to have a function that rotates an element on x axis by any desired degree.
function AnimateRotate(d,elem){
$({deg: 0}).animate({deg: d}, {
duration: 2000,
step: function(now){
elem.css({
transform: "rotate(" + now + "deg)"
});
}
});
}
Original source by yckart