日期:2014-05-16 浏览次数:20510 次
/* CSS Document */
* { margin:0; padding:0;}
body { background:#ecfaff;}
#main { position:relative; margin:200px auto 0; width:470px; height:150px; overflow:hidden;}
#main #big_pic { width:470px; height:150px; list-style:none;}
#main #big_pic li {width:470px; height:150px; position:absolute; overflow:hidden;}
#main #big_pic li a {width:470px; height:150px;}
#main #big_pic li a img {width:470px; height:150px; border:0;}
#main #big_pic li a:link { text-decoration:none;}
#main #pic_page { width:124px; height:23px; list-style:none; position:absolute; bottom:10px; right:10px; z-index:2000;}
.active { padding:2px 2px; font-weight:bold; color:#ffffff; background:#ffb442; position:relative; bottom: 2px; }
#main #pic_page li { width:19px; height:20px; float:left; border:1px solid #f47500; color:#d94b01; background:#fcf2cf; text-align:center; margin-right:3px;}
#main #pic_page li a { color:#f47500;}
#main #pic_page li a:link { text-decoration:none;}
<!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" />
<title>无标题文档</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="common.js"></script>
<script>
window.onload=function() {
var oDiv=document.getElementById('main');
var oUlBigPic=document.getElementById('big_pic');
var oUlPicPage=document.getElementById('pic_page');
var aLiBigPic=oUlBigPic.getElementsByTagName('li');
var aBtnPicPage=oUlPicPage.getElementsByTagName('li');
var current=0;
var currentZIndex=2;
//alert(aBtnPicPage.length);
for (var i=0;i<aBtnPicPage.length;i++) {
aBtnPicPage[i].index=i;
aBtnPicPage[i].onclick=function() {
if (current!=this.index) {
current=this.index;
for (var j=0;j<aBtnPicPage.length;j++) {
aBtnPicPage[j].className='';
}
aBtnPicPage[current].className='active';
aLiBigPic[current].style.height=0;
aLiBigPic[current].style.zIndex=currentZIndex++;
startMove(aLiBigPic[current], {height:150});
} else {
}
};
}
};
</script>
</head>
<body>
<div id="main">
<ul id="big_pic">
<li style="z-index:1;"><a href="javascript:;"><img src="images/1.jpg" /></a></li>
<li><a href="javascript:;"><img src="images/2.jpg" /></a></li>
<li><a href="javascript:;"><img src="images/3.jpg" /></a></li>