rss
twitter
    Find out what I'm doing, Follow Me :)

Image Rotation with Jquery Plugin

It is a great plugin for rotation of images with the help of Jquery.

This plugin is a copy of mooTools implementation made by Cédric for this library, check it out at http://www.piksite.com/mRotate/ (IT might be outdated!)

Download:

jQueryRotate.js

Description:


This is an final product of a Wilq32.PhotoEffect Snippet. Actually you can use this simple and tiny script to get effect of rotated images directly from client side (for ex. user generated content), and animate them using own functions.


Usage:

jQuery(imgElement).rotate(angleValue)

jQuery(imgElement).rotate(parameters)

jQuery(imgElement).rotateAnimation(parameters)

jQuery(imgElement).rotateAnimation(parameters)


Returns:


jQueryRotateElement - !!! NOTICE !!! function return rotateElement instance to help connect events with actually created 'rotation' element.


Parameters:

  • ({angle:angleValue,


  • [animateAngle:animateAngleValue],


  • [maxAngle:maxAngleValue],


  • [minAngle:minAngleValue],


  • [callback:callbackFunction],


    • [bind:[{event: function},{event:function} ] })

jQuery(imgElement).rotateAnimation


Where:

  • - angleValue - clockwise rotation given in degrees,

  • - [animateAngleValue] - optional parameter, animate rotating into this value,

  • - [maxAngleValue] - optional parameter, maximum angle possible for animation,

  • - [minAngleValue] - optional parameter, minimum angle possible for animation,

  • - [callbackFunction] - optional function to run after animation complete,

  • - [bind: [ {event: function}...] -optional parameter, list of events binded to newly created rotateable object
Examples:

$(document).ready(function()
{
$('#image').rotate(-25);


});


vikas nandal


$(document).ready(function()
{
$('#image2').rotate({angle:5});
});





$(document).ready(function()
{
var rot=$('#image3').rotate({maxAngle:50,minAngle:-55,
bind:
[
{"mouseover":function(){rot[0].rotateAnimation(50);}},
{"mouseout":function(){rot[0].rotateAnimation(-50);}}
]
});
});