请选择 进入手机版 | 继续访问电脑版

弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 2527|回复: 0

【jQuery】jquery.rotate图片旋转插件

[复制链接]
发表于 2016-8-1 09:53:42 | 显示全部楼层 |阅读模式
演示1 直接旋转一个角度
1
$('#img1').rotate(45);

演示2 鼠标移动效果
$('#img2').rotate({
    bind : {
        mouseover : function(){
            $(this).rotate({animateTo: 180});
        }, mouseout : function(){
            $(this).rotate({animateTo: 0});
        }
    }
});

演示3 不停旋转
var angle = 0;
setInterval(function(){
    angle +=3;
    $('#img3').rotate(angle);
}, 50);

var rotation = function (){
    $('#img4').rotate({
        angle: 0,
        animateTo: 360,
        callback: rotation
    });
}
rotation();

var rotation2 = function(){
    $('#img5').rotate({
        angle: 0,
        animateTo: 360,
        callback: rotation2,
        easing: function(x,t,b,c,d){
            return c*(t/d)+b;
        }
    });
}
rotation2();

演示4 点击旋转
$('#img6').rotate({
    bind: {
        click: function(){
            $(this).rotate({
                angle: 0,
                animateTo: 180,
                easing: $.easing.easeInOutExpo
            });
        }
    }
});

var value2 = 0;
$('#img7').rotate({
    bind: {
        click: function(){
            value2 +=90;
            $(this).rotate({
                animateTo: value2
            });
        }
    }
});
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-4-18 13:41 , Processed in 0.088966 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表