jQuery旋转插件jqueryrotate
来源:互联网 发布:数据库建立实现方案 编辑:程序博客网 时间:2024/05/22 00:17
CSS3 提供了多种变形效果,比如矩阵变形、位移、缩放、旋转和倾斜等等,让页面更加生动活泼有趣,不再一动不动。然后 IE10 以下版本的浏览器不支持 CSS3 变形,虽然 IE 有私有属性滤镜(filter),但不全面,而且效果和性能都不好。
今天介绍一款 jQuery 插件——jqueryrotate,它可以实现旋转效果。jqueryrotate 支持所有主流浏览器,包括 IE6。如果你想在低版本的 IE 中实现旋转效果,那么 jqueryrotate 是一个很好的选择。
兼容性
jqueryrotate 支持所有主流浏览器,包括 IE6。jqueryrotate 在高级浏览器中使用 CSS3 transform 属性实现,在低版本 IE 中使用 VML 实现。当然,你可以使用 IE 条件注释,低版本 IE 使用 jqueryrotate,高级浏览器则直接使用 CSS3。
使用方法
//演示1 //旋转45angle $(document.body).click(function () { //方式1 $('.divOne').rotate(45); //方式2 $('.divOne').rotate({ angle: 45 }); });
//演示2 //鼠标移动效果 //方式1 $('.divOne').rotate({ bind: { mouseover: function () { $(this).rotate({ animateTo: 180 }); }, mouseout: function () { $(this).rotate({ animateTo: 0 }); } } }); //方式2 $('.divOne').mouseover(function () { $(this).rotate({ animateTo: 180 }); }).mouseout(function () { $(this).rotate({animateTo:0}); });
//演示3 不停旋转 //方式1 var angle = 0; setInterval(function () { angle += 3; $('.divOne').rotate(angle); }, 50); //方式2 var rotation = function () { $('.divOne').rotate({ angle: 0, animateTo: 360, callback:rotation }) } rotation(); //方式3 var rotation = function () { $('.divOne').rotate({ angle: 0, animateTo: 360, callback: rotation, easing: function (x, t, b, c, d) { return c * (t / d) + b; } }) } rotation();
//演示4 点击旋转 //方式1 $('.divOne').click(function () { $(this).rotate({ angle: 0, animateTo: 180, easing: $.easing.easeInOutExpo }); }); var val = 0; $('.divOne').click(function () { val += 90; $(this).rotate({ animateTo: val }); });
参数
演示虽然使用的是图片,但 jqueryrotate 并不只是能运用在图片上,其他元素如 div 等也可以使用。同时,你可以发挥想象,制作出更多关于旋转的特效。
0 0
- jQuery旋转插件jqueryrotate
- jQuery旋转插件jqueryrotate
- jqueryrotate--jQuery旋转插件
- 【jQuery插件】-----旋转插件jqueryrotate
- jQuery旋转插件jqueryrotate,制作转盘
- 利用jQuery旋转插件jqueryrotate制作转盘抽奖
- JQueryRotate 图片旋转插件使用
- [jQuery插件] jqueryrotate:抽奖转盘
- html5 jqueryrotate插件实现旋转动画
- jquery 大转盘,jQueryRotate,源码
- jquery旋转插件 rotate
- jQuery旋转插件—rotate
- jQuery Feature Carousel 旋转插件
- jQuery旋转插件—rotate
- 一个jQuery旋转特效插件
- jquery旋转木马插件SLICK
- jQuery旋转插件—rotate
- jqueryrotate演示7种不同的旋转效果
- 为什么要做持续集成
- 使用struts2自带的json包返回JSON
- JS中关于clientWidth offsetWidth scrollWidth 等的含义
- read/write函数与(非)阻塞I/O的概念
- sguAC50,写一下前面的有价值的题目汇总
- jQuery旋转插件jqueryrotate
- vs2012和vs2010的vc++目录编辑功能已被否决
- C++ 流的捆绑
- hdu 5124 点的最多覆盖线段数+离散化
- Android中TraceView工具简述
- *a,与a[]区别
- Tomcat配置HTTPS
- 由C#风潮想起的——给初学编程者的忠告
- Spring整合JMS(一)---基于activeMQ的实现