网上发现一个很有意思的jQuery旋转插件,支持Internet Explorer 6.0+ 、Firefox 2.0 、Safari 3 、Opera 9 、Google Chrome,高级浏览器下使用Transform,低版本ie使用VML实现。
调用和方法:
rotate(angle)
angle参数:[Number] - 默认为 0 - 根据给定的角度旋转图片
例如:
1$("#img").rotate(45);
rotate(parameters)
parameters参数:[Object] 包含旋转参数的对象。支持的属性:
easing属性:[Function] - 默认 (see below) - Easing function used to make animation look more natural. It takes five parameters (x,t,b,c,d) to support easing from (for more details please see documentation at their website). Remember to include easing plugin before using it in jQueryRotate!Default function:
1function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }
Where:t: current time,
b: begInnIng value,
c: change In value,
d: duration,
x: unused
No easing (linear easing):
1function(x, t, b, c, d) { return (t/d)*c ; }
Example (click on arrow):
01$("#img").rotate({bind:{
02click: function(){
03$(this).rotate({
04angle: 0,
05animateTo:180,
06easing: $.easing.easeInOutElastic
07})
08}