0

I have a popup window called braviPopUp which I use to show images, I'm also rotating these images using a library jqueryrotate, however when I try to rotate the image using this function call : $('#img').rotate({ animateTo: 90}); I change the popup window's width to the image's width after rotation, but the image rotate on it's center and the popup window stays at where it is, resulting to two separated objects. I have tried to move the image over the exact place of the popup with no success and vice-versa.

What should I do? Is there any library that would serve what I want?

Thanks

SVI
  • 921
  • 4
  • 11
  • 23

2 Answers2

1

No libraries requried, Just check my fiddle Hope this helps http://jsfiddle.net/ZZ28s/

<img class="imageView" src="http://fc02.deviantart.net/fs70/i/2012/164/6/2/ej_colored_doodle_by_sweetwatermelonsweet-d53b5tq.jpg" style="max-width:350px;max-height:350px;"></img>
<input type="hidden" id="angleInput" value="90" />
<input type="button" value="Rotate Right Side" id="right" />
<input type="button" value="Rotate Left Side" id="left" />
Rachit Doshi
  • 183
  • 1
  • 6
  • My problem is not with rotation itself, the problem is when I rotate the image, it will spin around it's center point and of course width will be height and height will be width, so the popup window has to reshape itself too in order to fit the image within it's borders.. – SVI Jun 20 '13 at 12:28
0

I have successfully used this library to rotate images: https://github.com/louisremi/jquery.transform.js. Hope it helps.

quattel
  • 9
  • 2