这是一个图片切换的效果,我想在图片切换的时候加点效果应该如何做,还有要在鼠标离开这个区域之后如何让它显示默认的第一张图片
<!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>
</head>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
background-color: #B1B2B4;
background-image: url(images/bg.jpg);
background-repeat: repeat-x;
margin-right: 0px;
margin-bottom: 0px;
}
body,td,th {font-family: Verdana, Geneva, sans-serif;font-size: 12px;}
ul{ padding:0 0; margin:0 0;}
li{ list-style: none; margin:0 0; padding:0 0;}
#cont{ width:1004px; padding:0 0; margin:0 0;}
#change_pic{ width:719px; height:231px; background:#FDF0E0 url(images/ex_index_04.jpg) left top no-repeat; overflow:hidden; padding:3px 0 5px 3px;}
#change_btn{ width:138px; height:232px; overflow:hidden; float:left;}
#change_btn li{ margin-top:2px;background:#FFF;WIDTH: 138px; height:56px; text-align:center;CURSOR: pointer;}
#change_btn .current {BACKGROUND:#D22425;}
#change_btn img{ margin-top:3px;}
#notop{ margin-top:0px;}
#change_piclist {overflow:hidden;width:578px;height:230px; float:left; margin-left:3px; margin-top:2px;}
#change_piclist LI {OVERFLOW: hidden; WIDTH: 578px; HEIGHT: 230px}
#change_piclist IMG {WIDTH: 578px; HEIGHT: 230px; border:0;}
#change_piclist .normal {DISPLAY: none}
-->
</style>
<script language="javascript" type="text/javascript">
function $d(A){return document.getElementById(A)}
function classNormal(a,b){
var c=$d(a).getElementsByTagName("li");
var d=$d(b).getElementsByTagName("li");
for(var e=0;e<d.length;e++){
c[e].className="normal";
d[e].className="normal";
}
}
function classCurrent(A,C,F){
var E=$d(A).getElementsByTagName("li");
var B=$d(C).getElementsByTagName("li");
E[F].className="current";
F=F-1;
B[F].className="current";
}
function FocusChange(){
if(!$d("change_pic")){return false}
var A=$d("change_btn").getElementsByTagName("li");
A[0].onmouseover=function(){
classNormal("change_piclist","change_btn");
classCurrent("change_piclist","change_btn",1)
};
A[1].onmouseover=function(){
classNormal("change_piclist","change_btn");
classCurrent("change_piclist","change_btn",2)
};
A[2].onmouseover=function(){
classNormal("change_piclist","change_btn");
classCurrent("change_piclist","change_btn",3)
};
A[3].onmouseover=function(){
classNormal("change_piclist","change_btn");
classCurrent("change_piclist","change_btn",4)
};
}
</script>
<body>
<div id="change_pic">
<div id="change_btn">
<ul>
<li class="normal"><IMG src="http://ce-sunway.com/nimg/s10.jpg" ></li>
<li class="normal"><IMG src="http://ce-sunway.com/nimg/s13.jpg" ></li>
<li class="normal"><IMG src="http://ce-sunway.com/nimg/s15.jpg" ></li>
<li class="normal"><IMG src="http://ce-sunway.com/nimg/s17.jpg" ></li>
</ul>
</div>
<DIV id="change_piclist">
<UL>
<LI class="current"><A href="#"><IMG alt="" src="http://ce-sunway.com/nimg/01.jpg"></A> </LI>
<LI class="normal"><A href="#"><IMG alt="" src="http://ce-sunway.com/nimg/02.jpg"></A> </LI>
<LI class="normal"><A href="#"><IMG alt="" src="http://ce-sunway.com/nimg/03.jpg"></A></LI>
<LI class="normal"><A href="#"><IMG alt="" src="http://ce-sunway.com/nimg/04.jpg"></A></LI>
<LI class="normal"><A href="#"><IMG alt="" src="http://ce-sunway.com/nimg/05.jpg"></A></LI>
</UL>
</DIV>
</div>
<SCRIPT type=text/javascript>FocusChange();</SCRIPT>
</body>
</html>
用Jquery会很简单的