<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0036)http://fgm.cc/learn/lesson10/08.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>仿腾讯游戏《英雄杀》官网Flash效果</title>
<style type="text/css">
body,div,ul,li,h4,p{margin:0;padding:0;}
body{font:12px/1.8 arial;color:#fff;background:url(img/yxs/home_bg.jpg) 50% 0 no-repeat #000;}
a{color:#fff;text-decoration:none;background:#666;padding:2px 5px;}
a:hover{background:#F90;}
#box{position:relative;width:754px;height:292px;margin:115px auto 0;}
#box ul{position:relative;width:754px;height:292px;}
#box li{position:absolute;border:2px solid #000;list-style:none;background:#000;width:0;height:0;top:146px;left:377px;z-index:0;cursor:pointer;overflow:hidden;border-radius:3px;}
#box li img{width:100%;height:100%;vertical-align:top;}
#box li div{position:absolute;bottom:-100px;width:100%;height:100px;background:#000;filter:alpha(opacity=70);opacity:0.7;}
#box li div h4{margin:0 10px;font:12px/24px arial;border-bottom:1px #333 solid;}
#box li div h4 span{color:red;margin-left:10px;}
#box li div p{margin:5px 10px 0;text-indent:2em;}
#box .prev, #box .next{position:absolute;top:50%;width:39px;height:80px;margin-top:-40px;overflow:hidden;text-indent:-999px;cursor:pointer;background:url(img/yxs/btn.png) no-repeat;}
#box .prev{left:-60px;}
#box .next{right:-60px;background-position:-39px 0;}
#copyright{padding-top:10px;text-align:center;}
</style>
<script type="text/javascript">
function ZoomPic ()
{
this.initialize.apply(this, arguments)
}
ZoomPic.prototype =
{
initialize : function (id)
{
var _this = this;
this.wrap = typeof id === "string" ? document.getElementById(id) : id;
this.oUl = this.wrap.getElementsByTagName("ul")[0];
this.aLi = this.wrap.getElementsByTagName("li");
this.prev = this.wrap.getElementsByTagName("pre")[0];
this.next = this.wrap.getElementsByTagName("pre")[1];
this.timer = null;
this.aSort = [];
this.iCenter = 3;
this._doPrev = function () {return _this.doPrev.apply(_this)};
this._doNext = function () {return _this.doNext.apply(_this)};
this.options = [
{width:120, height:150, top:71, left:134, zIndex:1},
{width:130, height:170, top:61, left:0, zIndex:2},
{width:170, height:218, top:37, left:110, zIndex:3},
{width:224, height:288, top:0, left:262, zIndex:4},
{width:170, height:218, top:37, left:468, zIndex:3},
{width:130, height:170, top:61, left:620, zIndex:2},
{width:120, height:150, top:71, left:496, zIndex:1}
];
for (var i = 0; i < this.aLi.length; i++) this.aSort[i] = this.aLi[i];
this.aSort.unshift(this.aSort.pop());
this.setUp();
this.addEvent(this.prev, "click", this._doPrev);
this.addEvent(this.next, "click", this._doNext);
this.doImgClick();
this.timer = setInterval(function ()
{
_this.doNext()
}, 3000);
this.wrap.onmouseover = function ()
{
clearInterval(_this.timer)
};
this.wrap.onmouseout = function ()
{
_this.timer = setInterval(function ()
{
_this.doNext()
}, 3000);
}
},
doPrev : function ()
{
this.aSort.unshift(this.aSort.pop());
this.setUp()
},
doNext : function ()
{
this.aSort.push(this.aSort.shift());
this.setUp()
},
doImgClick : function ()
{
var _this = this;
for (var i = 0; i < this.aSort.length; i++)
{
this.aSort[i].onclick = function ()
{
if (this.index > _this.iCenter)
{
for (var i = 0; i < this.index - _this.iCenter; i++) _this.aSort.push(_this.aSort.shift());
_this.setUp()
}
else if(this.index < _this.iCenter)
{
for (var i = 0; i < _this.iCenter - this.index; i++) _this.aSort.unshift(_this.aSort.pop());
_this.setUp()
}
}
}
},
setUp : function ()
{
var _this = this;
var i = 0;
for (i = 0; i < this.aSort.length; i++) this.oUl.appendChild(this.aSort[i]);
for (i = 0; i < this.aSort.length; i++)
{
this.aSort[i].index = i;
if (i < 7)
{
this.css(this.aSort[i], "display", "block");
this.doMove(this.aSort[i], this.options[i], function ()
{
_this.doMove(_this.aSort[_this.iCenter].getElementsByTagName("img")[0], {opacity:100}, function ()
{
_this.doMove(_this.aSort[_this.iCenter].getElementsByTagName("img")[0], {opacity:100}, function ()
{
_this.aSort[_this.iCenter].onmouseover = function ()
{
_this.doMove(this.getElementsByTagName("div")[0], {bottom:0})
};
_this.aSort[_this.iCenter].onmouseout = function ()
{
_this.doMove(this.getElementsByTagName("div")[0], {bottom:-100})
}
})
})
});
}
else
{
this.css(this.aSort[i], "display", "none");
this.css(this.aSort[i], "width", 0);
this.css(this.aSort[i], "height", 0);
this.css(this.aSort[i], "top", 37);
this.css(this.aSort[i], "left", this.oUl.offsetWidth / 2)
}
if (i < this.iCenter || i > this.iCenter)
{
this.css(this.aSort[i].getElementsByTagName("img")[0], "opacity", 30)
this.aSort[i].onmouseover = function ()
{
_this.doMove(this.getElementsByTagName("img")[0], {opacity:100})
};
this.aSort[i].onmouseout = function ()
{
_this.doMove(this.getElementsByTagName("img")[0], {opacity:35})
};
this.aSort[i].onmouseout();
}
else
{
this.aSort[i].onmouseover = this.aSort[i].onmouseout = null
}
}
},
addEvent : function (oElement, sEventType, fnHandler)
{
return oElement.addEventListener ? oElement.addEventListener(sEventType, fnHandler, false) : oElement.attachEvent("on" + sEventType, fnHandler)
},
css : function (oElement, attr, value)
{
if (arguments.length == 2)
{
return oElement.currentStyle ? oElement.currentStyle[attr] : getComputedStyle(oElement, null)[attr]
}
else if (arguments.length == 3)
{
switch (attr)
{
case "width":
case "height":
case "top":
case "left":
case "bottom":
oElement.style[attr] = value + "px";
break;
case "opacity" :
oElement.style.filter = "alpha(opacity=" + value + ")";
oElement.style.opacity = value / 100;
break;
default :
oElement.style[attr] = value;
break
}
}
},
doMove : function (oElement, oAttr, fnCallBack)
{
var _this = this;
clearInterval(oElement.timer);
oElement.timer = setInterval(function ()
{
var bStop = true;
for (var property in oAttr)
{
var iCur = parseFloat(_this.css(oElement, property));
property == "opacity" && (iCur = parseInt(iCur.toFixed(2) * 100));
var iSpeed = (oAttr[property] - iCur) / 5;
iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed); if (iCur != oAttr[property])
{
bStop = false;
_this.css(oElement, property, iCur + iSpeed)
}
}
if (bStop)
{
clearInterval(oElement.timer);
fnCallBack && fnCallBack.apply(_this, arguments)
}
}, 30)
}
};
window.onload = function ()
{
new ZoomPic("box");
};
</script>
</head>
<body>
<div id="box">
<pre class="prev">prev</pre>
<pre class="next">next</pre>
<ul>
<li style="display: block; width: 120px; height: 150px; top: 71px; left: 131px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/10.jpg" style="opacity: 0.35;"><div style="bottom: -100px;"><h4>杨延昭<span>天狼星</span></h4><p>杨延昭是北宋抗辽大将杨业的长子,自幼就受到其父抵抗契丹、收复失地的思想影响。</p></div></li><li style="display: block; width: 130px; height: 170px; top: 61px; left: 2px; z-index: 2;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/11.jpg" style="opacity: 0.35;"><div style="bottom: -100px;"><h4>关羽<span>武圣</span></h4><p>关羽,字云长,本字长生,河东解县人(今山西省运城市),东汉末年三国时期刘备的重要将领。</p></div></li><li style="display: block; width: 170px; height: 218px; top: 37px; left: 114px; z-index: 3;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/12.jpg" style="opacity: 0.35;"><div><h4>鲁智深<span>花和尚</span></h4><p>鲁智深,梁山泊第十三位好汉,绰号花和尚。因为见郑屠欺侮金翠莲父女,三拳打死了镇关西。</p></div></li><li style="display: block; width: 224px; height: 288px; top: 0px; left: 267px; z-index: 4;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/13.jpg" style="opacity: 0.35;"><div><h4>赢政<span>秦始皇</span></h4><p>秦始皇,赢姓,赵氏,名政,秦庄襄王之子。秦始皇22岁时,在雍城举行国君成人加冕仪式。开始"亲理朝政"。</p></div></li><li style="display: block; width: 170px; height: 218px; top: 37px; left: 472px; z-index: 3;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/14.jpg" style="opacity: 0.35;"><div><h4>赵匡胤<span>宋太祖</span></h4><p>赵匡胤,中国北宋王朝的建立者,庙号太祖,汉族,涿州(今河北)人。出身军人家庭。高祖赵眺,祖父赵敬。</p></div></li><li style="display: block; width: 130px; height: 170px; top: 61px; left: 617px; z-index: 2;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/1.jpg" style="opacity: 0.35;"><div><h4>小乔<span>国色天香</span></h4><p>小乔,三国时期的主要女性人物之一。在三国时归属吴国,国色流离、资貌绝伦,是当时有名的东吴美女。</p></div></li><li style="display: block; width: 117px; height: 146px; top: 71px; left: 493px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/2.jpg" style="opacity: 0.35;"><div><h4>潘安<span>花样美男</span></h4><p>潘安,西晋文学家,本名潘岳。中国古代最著名的美男子之首、"金谷二十四友"之首。</p></div></li><li style="display: none; width: 0px; height: 0px; top: 37px; left: 377px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/3.jpg" style="opacity: 0.35;"><div style="bottom: -100px;"><h4>朱元璋<span>明太祖</span></h4><p>朱元璋,明王朝的开国皇帝,建立了全国统一的封建政权。</p></div></li><li style="display: none; width: 0px; height: 0px; top: 37px; left: 377px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/4.jpg" style="opacity: 0.35;"><div><h4>吕雉<span>吕后</span></h4><p>吕雉,西汉开国皇帝高祖刘邦的原配夫人,中国历史上第一位掌权的女性统治者。</p></div></li><li style="display: none; width: 0px; height: 0px; top: 37px; left: 377px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/5.jpg" style="opacity: 0.35;"><div><h4>诸葛亮<span>卧龙</span></h4><p>诸葛亮,蜀汉丞相,三国时期杰出的政治家、战略家、发明家、军事家。</p></div></li><li style="display: none; width: 0px; height: 0px; top: 37px; left: 377px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/6.jpg" style="opacity: 0.35;"><div><h4>李师师<span>青楼歌妓</span></h4><p>李师师,北宋末年色艺双绝的名妓,其事迹多见于野史,笔记小说。据传曾深受宋徽宗喜爱。</p></div></li><li style="display: none; width: 0px; height: 0px; top: 37px; left: 377px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/7.jpg" style="opacity: 0.35;"><div><h4>陈圆圆<span>乱世红颜</span></h4><p>陈圆圆,名沅,明末清初苏州名姬,浙江金华人氏。"容辞闲雅,额秀頣丰",有名士大家风度。</p></div></li><li style="display: none; width: 0px; height: 0px; top: 37px; left: 377px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/8.jpg" style="opacity: 0.35;"><div><h4>扁鹊<span>神医</span></h4><p>扁鹊精于内、外、妇、儿、五官等科,应用针灸、按摩、汤药、热熨等法治疗疾病,被尊为医祖。</p></div></li><li style="display: none; width: 0px; height: 0px; top: 37px; left: 377px; z-index: 1;"><img src="./仿腾讯游戏《英雄杀》官网Flash效果_files/9.jpg" style="opacity: 0.35;"><div><h4>西施<span>西子</span></h4><p>西施,名夷光,春秋时间越国人,今浙江诸暨市城关苎萝村。同范蠡同卒于陶(定陶)。</p></div></li></ul>
</div>
<div id="copyright">如蒙转载请注明出处 <a href="http://js.fgm.cc/">Fgm.cc</a> , By — Ferris, QQ:21314130</div> </body></html>

  

上述图片的化,可根据需求更改为自己需要的图片即可。
 

js之3D轮播图的更多相关文章

  1. jQuery与原生js实现banner轮播图

    jQuery与原生js实现banner轮播图: (jq需自己加载)(图片需自己加载) <!DOCTYPE html> <html> <head> <meta ...

  2. 原生JS实现简易轮播图

    原生JS实现简易轮播图(渐变?) 最近做网页总是会用到轮播图,我就把之前写的轮播图单独拿出来吧,如果有...如果真的有人也需要也可以复制去用用啊..哈~.. window.onload = funct ...

  3. CSS3之3D轮播图

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. JS+css3焦点轮播图PC端

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. js原生实现轮播图效果(面向对象编程)

    面向对象编程js原生实现轮播图效果 1.先看效果图 2.需要实现的功能: 自动轮播 点击左右箭头按钮无缝轮播 点击数字按钮切换图片 分析:如何实现无缝轮播? 在一个固定大小的相框里有一个ul标签,其长 ...

  6. JS学习笔记--轮播图效果

    希望通过自己的学习收获哪怕收获一点点,进步一点点都是值得的,加油吧!!! 本章知识点:index this for if else 下边我分享下通过老师教的方式写的轮播图,基础知识实现: 1.css代 ...

  7. 3d轮播图(另一种方式,可以实现的功能更为强大也更为灵活,简单一句话,比酷狗优酷的炫)

    前不久我做了一个3d仿酷狗的轮播图,用的技术原理就是简单的jquery遍历+css样式读写. 这次呢,我们换一种思路(呵呵其实换汤不换药),看到上次那个轮播吗?你有没有发现用jquery的animat ...

  8. 3d轮播图——类似酷狗的轮播

    说到轮播图,其实只要是跟web开发相关的无论是前端后端应该都不陌生,各种各样的轮播图,从以前的单纯的平面山水画遮盖滑动或滚动,到Jquery的animate甚至是h5+css3,各种炫酷的轮播图更是层 ...

  9. 原生 js 左右切换轮播图

    使用方法: 可能很多人对轮播图感兴趣,下面奉上本人的 原生 js 轮播代码复制 js 到页面的最底部,样式在 css 里改,js 基本不用动,有什么不懂的可以 加本人 QQ172360937 咨询 或 ...

随机推荐

  1. java并发容器之 SynchronousQueue [转]

    SynchronousQueue 这个队列实现了 BlockingQueue接口 该队列的特点 1.容量为0,无论何时 size方法总是返回0 2. put操作阻塞,jquery插件库  直到另外一个 ...

  2. 【ACM】求高精度幂

    题目来源:http://poj.org/problem?id=1001&lang=zh-CN 求高精度幂 Time Limit: 500MS   Memory Limit: 10000K To ...

  3. JDK 中的监控与故障处理工具-04 (jmap)

    jmap : memory map for java jmap 命令用于生成堆转储快照文件, 一般称为heapdump 或者 dump 文件.如果不是用 jmap 命令, 要获得 java 堆转储快照 ...

  4. c# iText 生成PDF 有文字,图片,表格,文字样式,对齐方式,页眉页脚,等等等,

    #region 下载说明书PDF protected void lbtnDownPDF_Click(object sender, EventArgs e) { int pid = ConvertHel ...

  5. 2017 ACM/ICPC Asia 南宁区 L The Heaviest Non-decreasing Subsequence Problem

    2017-09-24 20:15:22 writer:pprp 题目链接:https://nanti.jisuanke.com/t/17319 题意:给你一串数,给你一个处理方法,确定出这串数的权值, ...

  6. 在Mac中如何正确地设置JAVA_HOME

    前期准备 下载JDK安装包:在JDK1.8下载中选择Mac的JDK安装包 安装JDK:这里只要按照安装指引一步一步安装即可 查找JAVA_HOME 打开Mac的终端,检查JDK是否安装成功:java ...

  7. ABP 学习问题集锦

    一:Update-Database : 无法将“Update-Database”项识别为 cmdlet.函数.脚本文件或可运行程序的名称的问题 解决: 这是因为没有引用EntityFramework命 ...

  8. CentOS 7添加应用快捷方式到桌面

    以eclipse为例,编辑下面文件,复制到桌面即可. vi client.desktop [Desktop Entry]Encoding=UTF-8Name=eclipseExec=/home/clo ...

  9. Metasploit 使用简介

    Metasploit Framework 是非常优秀的开源渗透测试框架,像我这样的菜鸟刚刚听说,于是花时间好好研究了一下,整理了一下学习笔记,贴出来和大家一起交流.第一次写文章又不足的地方大家多多指点 ...

  10. 完整的保存onetab的书签信息

    之前在百度上找怎么完整的保存onetab的书签信息,没找到答案,于是乎上了google,在stackoverflow上找到了一个相关的答案 How to restore OneTab list of ...