Search code examples
javascriptjqueryrotationjcrop

How don't rotate jcrop


i have a problem with jcrop. I have a webpage with an image and two buttons to rotate it of +90° or -90° on its center (i use jQueryRotate), but when i use jcrop to select an area the selector is rotate too, and i don't want it rotates. I checked on internet and i found different solutions, but when i traced my code i noted jquery.Jcrop.js uses in the procedure getPos the .offset() methos and it always gives me the position of top-left corner at 0° degrees. Is there a methos to get always the position of the new top-left corner after i rotate the image of 90, 180, 270, ecc... degrees?


Solution

  • use separate buttons to rotate image

    $("input[name='rotate1']").click(function() {
         $("#photo").rotate(90);
         return false;
      });
    
    $("input[name='rotate2']").click(function() {
         $("#photo").rotate(-90);
         return false;
    });