
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="js/jquery-1.11.3.js"></script>
<script>
$(function(){
$("div").click(function(){
if($(this).hasClass("aa")){
$(this)
.animate({left:-10})
.animate({top:-10})
.animate({left:10})
.animate({top:-10})
.animate({left:-10})
.animate({left:-10})
}
$(this).animate({'left':-20,height:300})
}); }) </script>
</head>
<body>
<div class="aa" style="width: 100px;height: 100px;background: red;position: absolute;"></div>
</body>
</html>