<!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=gb2312" /> <script type='text/javascript' src='/ajaxjs/jquery1.3.2.js'></script> <title>點(diǎn)擊滑動(dòng)的效果</title> <style type="text/css"> .div{ width:300px; height:200px; background-color:#000000; z-index:0; position:absolute; left:10px; border:2px #3300FF solid; color:#FFFFFF; font-size:48px; margin-left:200px;} </style> <script type="text/javascript"> $(function(){ var z=-1; $("div").click(function(){ $(this).animate({left:"310px"},1000,function(){$(this).css("zIndex",z--)}).animate({left:"10px"},1000); }) }); </script> </head> <body> <div class="div" style="background-color:#FF0000">1</div> <div class="div" style="background-color:#999999;">2</div> <div class="div" style="background-color:#000000">3</div> <div class="div" style=" background-color:#009900">4</div> </div> 若有錯(cuò),請(qǐng)刷新頁(yè)面。 </body> </html>