![这里写图片描述](https://img-blog.csdn.net/20160103145920102)
<html>
<head>
<title>JS 实现3D立体效果的图片幻灯切换</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style>
html {
background:#000}
body, ul {
margin:0;padding:0}
li {
list-style:none}
img {
border:none;display:block}
.slide-wp {
width: 500px;
height: 300px;
overflow: hidden;
position: absolute;
left: 50%;
top: 50%;
margin-left: -250px;
margin-top: -150px;
}
.nav-wp {
position: absolute;
background: #ccc;
top: 50%;
margin-top: 170px;
left: 50%;
margin-left: -100px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
padding: 0 20px 6px 10px;
_padding: 0 20px 2px 10px;
}
.nav li {
float: left;
margin-left: 10px;
font-size: 20px;
font-weight: bold;
font-family: tahoma;
color: #22739e;
cursor: pointer;
height: 22px;
}
.nav li.cur{
color: #ff7a00}
.next {
position:absolute;
top: 0;
left: 160px;
padding: 4px 8px;
color: #ff7a00;
background: #ccc;
height: 20px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
cursor: pointer;
}
</style>
</head>
<body>
<h2 style="color:#fff">对于使用IE6的同学看到的斑点,我只能表示很无奈。。。</h2>
<div id="slider" class="slide-wp">
<ul>
<li><a href="http://www.newxing.com/" target="_blank"><img src="http://www.newxing.com/img/450/1.jpg" alt="" /></a></li>
<li><a href="http://www.newxing.com/" target="_blank"><img src="http://www.newxing.com/img/450/2.jpg" alt="" /></a></li>
<li><a href="http://www.newxing.com/" target="_blank"><img src="http://www.newxing.com/img/450/3.jpg" alt="" /></a></li>
<li><a href="http://www.newxing.com/" target="_blank"><img src="http://www.newxing.com/img/450/4.jpg" alt="" /></a></li>
<li><a href="http://www.newxing.com/" target="_blank"><img src="http://www.newxing.com/img/450/5.jpg" alt="" /></a></li>
</ul>
</div>
<div class="nav-wp">
<ul id="nav" class="nav">
<li onclick="mySlider.pos(0)">●</li>
<li onclick="mySlider.pos(1)">●</li>
<li onclick="mySlider.pos(2)">●</li>
<li onclick="mySlider.pos(3)">●</li>
<li onclick="mySlider.pos(4)">●</li>
</ul>
<a class="next" onclick="mySlider.move()">next</a>
</div>
<script type="text/javascript">
var HR = {
$ : function(i) {
return document.getElementById(i)},
$$ : function(c, p) {
return p.getElementsByTagName(c)},
ce : function(i, t) {
var o = document.createElement(i);
t.appendChild(o);
return o;
}
};
HR.slider3D = function () {
var init = function (o) {
this.o = o;
var wp = HR.$(o.id), ul = HR.$$('ul', wp)[0], li = this.li = HR.$$('li', ul);
this.l = li.length;
this.w = wp.offsetWidth;
this.h = wp.offsetHeight;
this.at = o.auto? o.auto : 4;
var con = this.con = HR.ce('div', wp);
con.style.cssText = 'position:absolute;left:0;top:0;width:'+this.w+'px;height:'+this.h+'px';
ul.style['display'] = 'none';
this.a1 = HR.ce('a', con);
this.a1.style.cssText = 'position:absolute;left:0;t