jQuery CSS Rotate Property Using CSS3 Transforms - Rotate

File Size: 17.7KB
Views Total: 11109
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery CSS Rotate Property Using CSS3 Transforms - Rotate

Rotate is a tiny jQuery plugin that allows you to rotate html elements (like images) using CSS3 transformations.

How to use it:

1. Include jQuery library and jQuery rotate in your website

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="jquery.rotate.js"></script>

2. Insert an image that you want to rotate

<img src="sun.png"/>

3. The javascript

<script>
$(function() {
var img = $('img');
function rotate() {
img.animate({rotate: '360'}, 2000, 'linear', function() {
rotate();
});
}
rotate();
});
</script>

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