挑戰(zhàn)實戰(zhàn)題
使用CSS樣式與jQuery分步驟實現(xiàn)車動畫向下開動效果
要求:
1、單擊車圖片,車圖片向下移動500px,移動時間設置600微秒。
任務
CSS樣式定位車圖片位置
1、為使車可以動起來,首先使用position、top、left進行定位。
用jQuery代碼讓車動起來
1、鼠標滑過圖片事件寫好。
2、鼠標滑過圖片后觸發(fā)動作:車圖片向下移動(使用animate方法改變top屬性實現(xiàn)動畫)。
<!DOCTYPE html>
<html>
<head>
<title>停車動畫</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css">
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<img class="car" src="http://img1.sycdn.imooc.com//5343d553000107a107200701.jpg" width="350" height="341"/>
</body>
</html>
$(document).ready(function(){
});
*{ padding:0px; margin:0px; }
body{
background:#D5DEE7;
}
.car{
}
請驗證,完成請求
由于請求次數(shù)過多,請先驗證,完成再次請求