0

I'm trying to do something like this, but i need some modifications that i don't know how to do..

Example: http://demo.superdit.com/jquery_image_rotate/

But in that example i've got some issues. After rotating 360º looks like it goes crazy... probably the math of the code... and i need to rotate the image that i'm clicking on, not only by the center... but any place of the image i click and drag, it rotates on its axis.

Someone have any idea how to mod that code? Thanks!

ps: Sorry about my english

2
  • Please post your code. It would be excellent if you could port the functionality to a jsfiddle, too, so others can manipulate it at will.
    – cheeken
    Jan 27, 2012 at 20:59
  • Might want to check out this link: stackoverflow.com/questions/7873470/…. Uses canvas.
    – j08691
    Jan 27, 2012 at 21:26

2 Answers 2

0

You could use Raphaël, it supports things like drawing, dragging and rotating images.

Simple example for drawing and dragging an image: http://jsfiddle.net/8j8HP/1/

Simple example for rotating an image, where the center of rotation is not the center of the image: http://jsfiddle.net/wXctQ/

Now you just have to calculate the angle from the mouse position to the center of the rotation.

-1

Try propeller.js it is a library to rotate HTML elements by mouse or touch https://github.com/PixelsCommander/Propeller

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.