您当前位置: 首页 » web前端 » html5+css3 » web前端 » jquery » jquery+css 点击图片旋转特效

jquery+css 点击图片旋转特效

2015年5月12日 | 蒙奇·D·撸码客 发表评论(0) 查看评论

<script>
var n = 0;
var cssInterval;
function startRotate() {
n = n – 2;
$(“.messageTitle em”).css({
“transform”: “rotate(” + n + “deg)”,
“webkitTransform”: “rotate(” + n + “deg)”,
“OTransform”: “rotate(” + n + “deg)”,
“MozTransform”: “rotate(” + n + “deg)”
});

if (n == -180 || n == -360) {
clearInterval(cssInterval);
if (n == -360) {
n = 0
};
}
}
$(document).ready(function() {

$(“.messageTitle em”).click(function() {
clearInterval(cssInterval);
cssInterval = setInterval(“startRotate()”, 1);

});
</script>

 

<div class=”messageTitle”>点击旋转<em><img src=”http://nvyou.zhaicool.net/wp-content/themes/edc/img/logo.png”></em></div>


html5+css3,jquery内容推荐

发表评论?

0 条评论。

发表评论