Jquery实现的图标抖动效果

 

原文:http://www.webdm.cn/webcode/75de64a9-3fb4-473d-bc2c-97a0a063be79.html

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jquery实现的图标抖动效果_网页代码站(www.webdm.cn)</title>
<script src="http://www.webdm.cn/themes/script/jquery.js"></script>
<script>
$(function(){
         function state1(){
             $(".rotate").removeClass("r2"); 
             $(".rotate").addClass("r1");
             setTimeout(state2,90);
         }
        function state2(){       
             $(".rotate").removeClass("r1");
             $(".rotate").addClass("r2"); 
             setTimeout(state1,90);
        }
        state1();
        
})


</script>

<style>
body{
    background:url(wood-oak.jpg);
}

.tips{
    width:650px;
    margin:110px auto 0;
    font-family:Verdana, Geneva, sans-serif;
    color:#FFC;
    font-size:26px;
}

.dock{
    margin:90px auto 0;
    width:500px; 
}

.board{
    float:left;
    margin-top:-60px;
    z-index:0;
}

.rotate{
    width:70px;
    height:70px;
    margin:20px 10px;
    z-index:1;
}

.r1{
     -moz-transform:rotate(-3deg);
    -webkit-transform:rotate(-3deg);
    -o-transform:rotate(-3deg);
}

.r2{
     -moz-transform:rotate(2deg);
    -webkit-transform:rotate(2deg);
    -o-transform:rotate(2deg);
}
</style>
</head>

<body>
<p class="tips">Tip: You may need to use the browser like chrome锛?firefox or safari  which supports CSS attribute to watch this rotate effect...</p>
<div class="dock">
      <img src="http://www.webdm.cn/images/20130701/FireFox.png" class="rotate" alt="icon"/>
      <img src="http://www.webdm.cn/images/20130701/IE.png" class="rotate" alt="icon"/>
</div>
<img  class="board" src="http://www.webdm.cn/images/20130701/woodboard1.png" />
<br />
<p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的网页代码下载网站 - 致力为中国站长提供有质量的网页代码!</p>
</body>
</html>

 

转载于:https://www.cnblogs.com/shihaiming/p/6277380.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值