html结构:
<div class="top">
<a href="#">
<div>
<img src="images/top1.jpg" width="80" height="79" class="to_top" />
</div>
</a>
<a href="index.html">
<div style="border-top:1px solid #f7efd5;border-bottom:1px solid #f7efd5; ">
<img src="images/top2.jpg" width="80" height="79" id="dd" />
</div>
</a>
<a>
<div>
<img src="images/top3.jpg" width="80" height="79" />
</div>
</a>
</div>
css样式:
.dd {
animation: shake 1s;}
js效果:
<script type="text/javascript">
$("#dd").mouseenter(function () {
$(this).addClass("dd");
});
$("#dd").mouseleave(function () {
$(this).removeClass("dd");
});
</script>
效果:
鼠标经过home图标时,图标会左右晃动。
原文地址:http://blog.csdn.net/u012011360/article/details/43969719