-5

I want to know how to rotate an image arround its center.

I want when i click on the image,the picture will start rotating as long as an ajax call not successful.

Please help me to find out.

Kunj
  • 1,980
  • 2
  • 22
  • 34

2 Answers2

2

Try any of this code on your css,(this will work only on mouse hover.)

 -webkit-transform: scale(1.1) rotate(5deg*);
  -moz-transform: scale(1.1) rotate(5deg);
  transform: scale(1.1) rotate(5deg);
  • you can edit here to rotate on your desire.

Example, CSS

.alt-col:hover {
  -webkit-transform: scale(1.1) rotate(5deg);
  -moz-transform: scale(1.1) rotate(5deg);
  transform: scale(1.1) rotate(5deg);
}

HTML

 <img src="" alt="" class="alt-col">
Kiran RS
  • 981
  • 14
  • 31
-1

You can switch images with css classes corresponding to the success of the ajax request :

  • when the ajax request isn't over / fail -> use a gif or a CSS animation to rotate it
  • when the request is complete, add a class "success" on your element to stop the animation, or change the image.
enguerranws
  • 8,087
  • 8
  • 49
  • 97
  • Yes but how. You've stated what he could do but not how to do it. – Liam Dec 27 '13 at 11:03
  • I gave him a way to do it. SO is not just about giving code to people. I'd rather explain a guy how to do it instead of giving him a working code that he doesn't understand. – enguerranws Dec 28 '13 at 17:51
  • BTW, as he didn't post any code part, I don't know how I could post code. – enguerranws Dec 28 '13 at 17:52
  • No SO, is not just about giving code, it's about giving code **and** explaining [why they should do it this way](http://meta.stackexchange.com/a/203848/217110). – Liam Dec 30 '13 at 08:49