Cross browser jQuery Image Rotation Plugin - Download Cross-browser jQuery Image Rotation Plugin - jqueryRotate

Download Cross-browser jQuery Image Rotation Plugin – jqueryRotate

Posted on

This time I will share jQuery Plugin and tutorial about Cross-browser jQuery Image Rotation Plugin – jqueryRotate, hope it will help you in programming stack.

Cross browser jQuery Image Rotation Plugin - Download Cross-browser jQuery Image Rotation Plugin - jqueryRotate
File Size: 43.6 KB
Views Total: 1824
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

jqueryRotate is a lightweight, cross-browser jQuery plugin used to rotate an image to any angle using CSS3 transforms. With fallsbacks to CANVAS and/or VML (IE6) for old browsers which don’t support CSS3 transform property.

How to use it:

1. Place the script jQueryRotate.js after jQuery library and the jqueryRotate is ready for use.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="jQueryRotate.js"></script>

2. The JavaScript to rotate your image by a given angle.

1 $("img").rotate(180);

3. Add an animation to the image while rotating.

1 $("img").rotate({
2   angle: 0,
3   animateTo:180
4 });

4. Config the duration of the rotate animation.

1 $("img").rotate({
2   angle: 0,
3   animateTo:180,
4   duration:6000
5 });

5. Easing function is supported as well.

1 $("img").rotate({
2   angle: 0,
3   animateTo:180,
4   easing: function(){}
5 });

6. Execute a callback function when the animation is completely finished.

1 $("img").rotate({
2   angle: 0,
3   animateTo:180,
4   callback: function(){}
5 });

7. Get the current angle of rotated image.

1 $("img").rotate({
2   angle: 0,
3   animateTo:180,
4   callback: function(){
5     alert($(this).getRotateAngle());
6   }
7 });

8. Stop the rotate animation manually.

1 $("img").stopRotate();

This awesome jQuery plugin is developed by wilq32. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net