0

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.

infinityskyline
  • 369
  • 2
  • 4
  • 17

1 Answers1

0

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

George Sfitis
  • 75
  • 1
  • 10