我希望我的圖像在這個動畫頂部,這是代碼。這是什麼問題使用jquery動畫圖像頂部
<!DOCTYPE HTML>
<html>
<head>
<title>Majid</title>
<style>
* {
margin: 0 auto;
padding: 0;
}
body {
background: #333;
}
#box {
width: 391px;
height: 131px;
margin-top: 300px;
background: #555;
position: relative;
}
.icon {
width: 128px;
height: 128px;
float: left;
border-1px solid #fff;
margin: 1px;
}
</style>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function icons(){
$("a img").animate({ top: '128px' }, 300);
}
</script>
</head>
<body>
<div id="box">
<a href="JavaScript:();" onclick="icons();" class="icon"><img src="images/fb.jpg" alt="" /></a>
<a href="JavaScript:();" onclick="icons();" class="icon"><img src="images/tt.jpg" alt="" /></a>
<a href="JavaScript:();" onclick="icons();" class="icon"><img src="images/gp.jpg" alt="" /></a>
</div>
</body>
</html>
甲酸代碼PLZ –
ü可以使小提琴? –