jQuery旋转插件,支持Internet Explorer 6.0 + 、Firefox 2.0、Safari 3、Opera 9、Google Chrome,高级浏览器下使用Transform,低版本ie使用VML实现。调用和方法: < strong> rotate(angle) angle参数:[Number]–默认为0–根据给定的角度旋转图片例如:

$("#img").rotate(45);

rotate(parameters) parameters参数:[Object]包含旋转参数的对象。支持的属性:

  1. angle属性:[Number]–default 0–旋转的角度数,并且立即执行例如:

    $("#img").rotate({angle:45});
  2. bind属性:[Object]对象,包含绑定到一个旋转对象的事件。事件内部的$(this)指向旋转对象-这样你可以在内部链式调用-$(this).rotate(…)。例如(click on arrow):
    $("#img").rotate({bind:{click:function(){$(this).rotate({angle:0,animateTo:180})}}});
  3. animateTo属性:[Number]–default 0–从当前角度值动画旋转到给定的角度值(或给定的角度参数)例如:结合上面的例子,请参阅使用。
  4. duration属性: [Number]–指定使用animateTo的动画执行持续时间例如 (click on arrow) :
        $("#img").rotate({
    bind: {
    click: function() {
    $(this).rotate({
    duration: 6000,
    angle: 0,
    animateTo: 100
    })
    }
    }
    });
  5. step属性: [Function]–每个动画步骤中执行的回调函数,当前角度值作为该函数的第一个参数
  6. 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 http:
        function(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):

        function(x,t,b,c,d){return(t/d) * c
    }

    Example(click on arrow):

    $("#img").rotate({bind:{click:function(){$(this).rotate({angle:0,animateTo:180,easing:$.easing.easeInOutElastic})}}});
  7. callback属性:[Function]动画完成时执行的回调函数例如(click on arrow):
    $("#img").rotate({bind:{click:function(){$(this).rotate({angle:0,animateTo:180,callback:function(){alert(1)}})}}});

getRotateAngle 这个函数只是简单地返回旋转对象当前的角度。例如:

$("#img").rotate({angle:45,bind:{click:function(){alert($(this).getRotateAngle())}}});

stopRotate 这个函数只是简单地停止正在进行的旋转动画。例如:

$("#img").rotate({bind:{click:function(){$("#img").rotate({angle:0,animateTo:180,duration:6000});setTimeout(function(){$("#img").stopRotate()},1000)}}});

用这个可以实现很多关于旋转的网页特效。

jQuery旋转插件的更多相关文章

  1. html5网页动画总结--jQuery旋转插件jqueryrotate

    CSS3 提供了多种变形效果,比如矩阵变形.位移.缩放.旋转和倾斜等等,让页面更加生动活泼有趣,不再一动不动.然后 IE10 以下版本的浏览器不支持 CSS3 变形,虽然 IE 有私有属性滤镜(fil ...

  2. jQuery旋转插件—rotate-摘自网友

    jQuery旋转插件—rotate 时间:2013年01月03日作者:愚人码头查看次数:5,660 views评论次数:6条评论 网上发现一个很有意思的jQuery旋转插件,支持Internet Ex ...

  3. jQuery旋转插件—rotate

    jQuery旋转插件,支持Internet Explorer 6.0+ .Firefox 2.0 .Safari 3 .Opera 9 .Google Chrome rotate(angle) 正值表 ...

  4. jQuery旋转插件jqueryrotate 图片旋转

    "jquery.rotate.min.js"是jQuery旋转rotate插件,支持Internet Explorer 6.0+ .Firefox 2.0 .Safari 3 .O ...

  5. jQuery旋转插件jquery.rotate.js 让图片旋转

    演示1 直接旋转一个角度 $('#img1').rotate(45); 演示2 鼠标移动效果 $('#img2').rotate({ bind : { mouseover : function(){ ...

  6. jquery旋转插件rotate参数说明

    具体可见:http://www.jianshu.com/p/b632a1ed6a57

  7. 13 款最棒的 jQuery 图像 360° 旋转插件

    在 web 页面上使用 jQuery 图像 360 度旋转插件是最美也是最方便的显示图像的方式.这些超级棒的 360° 图像选择插件允许用户更详细的分析产品或者文章.jQuery 图像旋转插件可以让用 ...

  8. Glide.js:响应式 & 触摸友好的 jQuery 滑块插件

    Glide.js 是一款响应式和对触摸友好的 jQuery 滑块.基于 CSS3 转换实现,并在低版本浏览器降级处理.Glide.js 简单,重量轻,快速,适用于智能手机,平板电脑和台式机.它支持 s ...

  9. Salvattore:CSS 驱动的 jQuery Masonry 插件

    Salvattore 是一个 jQuery 砌体的替代,使用 CSS 驱动的配置.Salvattore 根据您指定的列数组织你的 HTML 元素.容器中的每一个项目会一个接一个被放置在列内,只需要简单 ...

随机推荐

  1. python——os模块操作文件

  2. UI基础 - UITabBarController

    self.window = [[UIWindow alloc] init]; self.window.frame = [UIScreen mainScreen].bounds; oneViewCont ...

  3. Spring Boot集成Jasypt安全框架

    Jasypt安全框架提供了Spring的集成,主要是实现 PlaceholderConfigurerSupport类或者其子类. 在Sring 3.1之后,则推荐使用PropertySourcesPl ...

  4. iPhone之为UIView设置阴影(CALayer的shadowColor,shadowOffset,shadowOpacity,shadowRadius,shadowPath属性)

    效果图: 以下代码实现: 第一个图片的代码 //加阴影--任海丽编辑 _imageView.layer.shadowColor = [UIColor blackColor].CGColor;//sha ...

  5. PLSQL死循环

    begin loop insert into for1 values('a'); commit; end loop; end;

  6. ehci符合USB2.0,uhci,ohci,

    uhci   ohci   ehci他们都是主机控制器的规格,OHCI主要为非PC系统上以及带有SiShe ALi芯片组的 PC主板上的USB芯片,UHCI大多为Intel和Via主板上的USB控制器 ...

  7. POJ 1511 SPFA+邻接表 Invitation Cards

    题目大意: 计算从 1 点 到 其他所有点的 往返距离之和, 因为是 有向图, 所以我们需要将图反存 一次, 然后求两次单源最短路, 结果就出来了. #include <iostream> ...

  8. yui--datatable 更新table数据

    使用render可以重新渲染datatable,之前添加的样式等信息也想相应会初始化,另外行定位等也会失效 使用updateRows方法不会删除样式等信息 更新datasource中_oData数据 ...

  9. Nodejs in Visual Studio Code 01.简单介绍Nodejs

    1.开始 作者自己:开发人员,Asp.Net , html / js , restful , memcached , oracle ,windows , iis 目标读者:供自己以后回顾 2.我看No ...

  10. Linux下遍历目录及文件,更改权限

    Linux下遍历目录及文件,更改权限 引言: 我在Linux下搭建android时,将eclipse及sdk复制到/usr/下时,总会出现无法读,无法写写样的问题. 解决方案: 有两个方案: 一.将复 ...