<!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>? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />? <title>停車動畫</title>? <script type="text/ecmascript" src="jquery-1.3.1.js"></script>? <script type="text/ecmascript">? ? ?$(document).ready(function(){ ? $('.boxgrid').hover(function(){ ? $("car").animate({left:'0px'},{duratin:300}); },function(){ ? ? ? ? ?$(".car").animate({left:'720px'},{duration:300}); }); });? </script>? <style type="text/css">? ? ? *{ padding:0px; margin:0px; } ?body{? ?background:#D5DEE7;? ?} ?.boxgrid{? ?width: 720px;? ?height: 701px;? ?border: solid 2px #8399AF; ?position:relative;? ?} ?.boxgrid img.car{? ?position: absolute;/*設置絕對定位*/ ? ?top: 0;? ?left:720px; ?}? </style>? </head><body>? <div class="boxgrid">?? <img class="car" src="搶車位動畫制作(源代碼)/car.png" width="720" height="701" />? ?<img src="搶車位動畫制作(源代碼)/carport.png" width="720" height="701" />? ? </div></body></html>為什么沒有滑動效果,看了一天了還是不懂
關于完整代碼
qq_紫牛_1
2015-11-10 20:29:41