1、 立体图片展示【荐】超绚的 JavaScript 立体图片展示代码 - html overflow: hidden;body position: absolute;margin: 0px;padding: 0px;background: #fff;width: 100%;height: 100%;#screen position: absolute;left: 10%;top: 10%;width: 80%;height: 80%;background: #fff;#screen img position: absolute;cursor: pointer;width: 0px;height:
2、 0px;-ms-interpolation-mode:nearest-neighbor;#bankImages visibility: hidden;#FPS position: absolute;right: 5px;bottom: 5px;font-size: 10px;color: #666;font-family: verdana;var Library = ;Library.ease = function () this.target = 0;this.position = 0;this.move = function (target, speed) this.position +
3、= (target - this.position) * speed;var tv = O : ,fps : 0,screen : ,angle : x : new Library.ease(),y : new Library.ease(),camera : x : new Library.ease(),y : new Library.ease(),create3DHTML : function (i, x, y, z, sw, sh) var o = document.createElement(img);o.src = i.src;tv.screen.obj.appendChild(o);
4、o.point3D = x : x,y : y,z : new Library.ease(),sw : sw,sh : sh,w : i.width,h : i.height;o.point3D.z.target = z;o.point2D = ;tv.O.push(o);o.onmouseover = function () if (this != tv.o) this.point3D.z.target = tv.mouseZ;tv.camera.x.target = this.point3D.x;tv.camera.y.target = this.point3D.y;if (tv.o) t
5、v.o.point3D.z.target = 0;tv.o = this;return false;o.onmousedown = function () if (this = tv.o) if (this.point3D.z.target = tv.mouseZ) this.point3D.z.target = 0;else tv.o = false;this.onmouseover();o.animate = function () var x = this.point3D.x - tv.camera.x.position;var y = this.point3D.y - tv.camer
6、a.y.position;this.point3D.z.move(this.point3D.z.target, this.point3D.z.target ? .15 : .08);var xy = tv.angle.cx * y - tv.angle.sx * this.point3D.z.position;var xz = tv.angle.sx * y + tv.angle.cx * this.point3D.z.position;var yz = tv.angle.cy * xz - tv.angle.sy * x;var yx = tv.angle.sy * xz + tv.angl
7、e.cy * x;var scale = tv.camera.focalLength / (tv.camera.focalLength + yz);x = yx * scale;y = xy * scale;var w = Math.round(Math.max(0, this.point3D.w * scale * this.point3D.sw);var h = Math.round(Math.max(0, this.point3D.h * scale * this.point3D.sh);var o = this.style;o.left = Math.round(x + tv.scre
8、en.w - w * .5) + px;o.top = Math.round(y + tv.screen.h - h * .5) + px;o.width = w + px;o.height = h + px;o.zIndex = 10000 + Math.round(scale * 1000);,/* = http:/ = */init : function (structure, FL, mouseZ, rx, ry) this.screen.obj = document.getElementById(screen);this.screen.obj.onselectstart = func
9、tion () return false; this.screen.obj.ondrag = function () return false; this.mouseZ = mouseZ;this.camera.focalLength = FL;this.angle.rx = rx;this.angle.ry = ry;var i = 0, o;while( o = structurei+ )this.create3DHTML(o.img, o.x, o.y, o.z, o.sw, o.sh);this.resize();mouse.y = this.screen.y + this.scree
10、n.h;mouse.x = this.screen.x + this.screen.w;setInterval(tv.run, 16);setInterval(tv.dFPS, 1000);,resize : function () var o = tv.screen.obj;if (o) tv.screen.w = o.offsetWidth / 2;tv.screen.h = o.offsetHeight / 2;for (tv.screen.x = 0, tv.screen.y = 0; o != null; o = o.offsetParent) tv.screen.x += o.of
11、fsetLeft;tv.screen.y += o.offsetTop;,run : function () tv.fps+;tv.angle.x.move(-(mouse.y - tv.screen.h - tv.screen.y) * tv.angle.rx, .1);tv.angle.y.move( (mouse.x - tv.screen.w - tv.screen.x) * tv.angle.ry, .1);tv.camera.x.move(tv.camera.x.target, .025);tv.camera.y.move(tv.camera.y.target, .025);tv.
12、angle.cx = Math.cos(tv.angle.x.position);tv.angle.sx = Math.sin(tv.angle.x.position);tv.angle.cy = Math.cos(tv.angle.y.position);tv.angle.sy = Math.sin(tv.angle.y.position);var i = 0, o;while( o = tv.Oi+ ) o.animate();,dFPS : function () document.getElementById(FPS).innerHTML = tv.fps + FPS;tv.fps =
13、 0;var mouse = x : 0,y : 0document.onmousemove = function(e) if (window.event) e = window.event;mouse.x = e.clientX;mouse.y = e.clientY;return false;onload = function() onresize = tv.resize;var img = document.getElementById(bankImages).getElementsByTagName(img);var structure = ;for (var i = -300; i
14、网页代码站 - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!图片的自动切换CSS+JS 控制遮罩效果的 TAB 及焦点图片切换(荐) - div, ul, ol, li, dl, dt, dd margin:0;padding:0;.imgFlash,.tabmargin:auto/*-焦点图片的 css-*/.imgFlash height:230px;width:270px;position:relative;.imgFlash dl height:100%;overflow:hidden;position:absolute;width:100%;.imgFlash img
15、height:100%;position:absolute;width:100%;background-color: #FFFFFF;background-repeat: no-repeat;background-position: center center;.imgFlash dt bottom:0;font-size:12px;height:24px;line-height:24px;left:0;position:absolute;width:100%;z-index:1;.imgFlash dt span background-color:#000000;height:100%;op
16、acity:0.4;filter:Alpha(Opacity=40);position:absolute;width:100%;.imgFlash dt a color:#FFFFFF;position:absolute;text-decoration:none;text-indent:5px;z-index:1;.imgFlash dt a:hover text-decoration:underline;.imgFlash div bottom:8px;cursor:pointer;display:block;position:absolute;right:8px;z-index:99999
17、;.imgFlash div em background-color:#000000;border:1px solid #FFFFFF;display:block;float:right;height:4px;margin-right:3px;filter:Alpha(Opacity=50);opacity:0.5;overflow:hidden;width:4px;.imgFlash div em.d /*激活的小方块的样式 */background-color:#CC0000;filter:Alpha(Opacity=80);opacity:0.8;/*-Tab 的 css-*/.tab,
18、.tab ullist-style-type: none;.tabwidth:270px;background-color:#FFFFFF;height: 160px;font-size: 12px;position: relative;border-top-width: 30px;border-right-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-top-style: solid;border-right-style: solid;border-bottom-style: solid;border-le
19、ft-style: solid;border-top-color: #0066FF;border-right-color: #0066FF;border-bottom-color: #0066FF;border-left-color: #0066FF;.tab ul position: absolute;top: -30px;.tab lifloat:left;background-color:#A9CEEB;background-repeat:no-repeat;background-position:left top;margin-top:5px;margin-left: 5px;.tab
20、 li.d background-color: #FFFFFF;.tab li atext-decoration:none;display:block;padding-right:8px;padding-left:8px;line-height:25px;color:#2B6FA2;.tab li.d acolor:#0C3E74;.tab li ulborder-bottom-style:none;position:absolute;left:0px;top:30px;background-color: #FFFFFF;padding-top: 10px;width: 270px;.tab
21、li lifloat:none;background-image:none;margin:0px;background-color: #FFFFFF;.tab li li abackground-image:none;line-height:22px;color: #000000;float: none;height: 22px;.tab li ul li a:hovertext-decoration:underline;.tab li.d li acolor:#000000;var $ = function (d)return document.getElementById( d );var
22、 isIE = (document.all) ? true : false;var Bind = function (obj,fun,arr)return function() arr | (arr = arguments);return fun.apply(obj,arr);/绑定var Tween = function(t,b,c,d)return c*t/d + b;/缓冲函数function addEventHandler(oTarget, sEventType, fnHandler) if (oTarget.addEventListener) oTarget.addEventList
23、ener(sEventType, fnHandler, false); else if (oTarget.attachEvent) oTarget.attachEvent(“on“ + sEventType, fnHandler); else oTarget“on“ + sEventType = fnHandler;/事件监听function removeEventHandler(oTarget, sEventType, fnHandler) if (oTarget.removeEventListener) oTarget.removeEventListener(sEventType, fnH
24、andler, false); else if (oTarget.detachEvent) oTarget.detachEvent(“on“ + sEventType, fnHandler); else oTarget“on“ + sEventType = null;/移除监听var Timer = ;/TimerTimer.add = function (fn)return new this.fn(fn);Timer.fn = function (fn)var timer;this.play = function (speed,only)speed | ( speed = 10 );if(o
25、nly)timer = window.setTimeout(fn,speed);else timer = window.setInterval(fn,speed);this.stop = function ()clearTimeout(timer);clearInterval(timer);/Mask 遮罩动画var Mask = function ()this.fl = Timer.add(Bind(this,this.fn);this.from_num = 0;this.speed = 50;/动画速度,越大越慢;Mask.prototype.ready = function (ele,p
26、os)if(this.ele)this.set(this.maxWidth,this.maxHeight);this.ele = ele;this.maxWidth = this.ele.offsetWidth;this.maxHeight = this.ele.offsetHeight;this.ele.style.position = “absolute“;this.from_num = 0;if(!pos)var x = “left“,“center“,“right“,“parseInt(4*Math.random(),y = “top“,“center“,“bottom“,“parse
27、Int(4*Math.random();if(x = “ /避免同时为“ this.position = x,y; elsethis.position = pos;this.set(0,0);this.fl.stop();Mask.prototype.start = function ()this.fl.play();Mask.prototype.stop = function ()this.fl.stop();Mask.prototype.set = function (width,height)/设置遮罩的矩形,用于定位遮罩的变换方向var t,r,b,l;switch(this.posi
28、tion0)case “left“ : l = 0; r = width; break;case “center“ : l = (this.maxWidth - width)/2; r = (this.maxWidth + width)/2;break;case “right“ : l = this.maxWidth - width;r = this.maxWidth; break;default:l = 0;r = this.maxWidth; switch(this.position1)case “top“ : t = 0; b = height; break;case “center“
29、: t = (this.maxHeight - height)/2; b = (this.maxHeight + height)/2;break;case “bottom“ : t = this.maxHeight - height;b = this.maxHeight; break;default :t = 0;b = this.maxHeight;break; this.ele.style.clip = “rect(“+ t + “px,“+ r + “px,“+ b + “px,“+ l + “px)“ ;Mask.prototype.fn = function ()var w,h; t
30、his.from_num + ;if(this.from_num1)var A = _nav.getElementsByTagName(“A“)0;addEventHandler(A,type,Bind(this,fun,A);if(_nav.nodeType = 1)_nav.getElementsByTagName(“UL“)0.style.zIndex = nav.length-i;function fun(ele)var li = ele.parentNode;var ul = li.getElementsByTagName(“UL“)0;this.z += 1ul.style.zIn
31、dex = this.z;if(li.className=“d“)return;li.className+=(li.className.length0? “ “: “) + “d“;this.focusEle.className=this.focusEle.className.replace(/( ?|)db/g, “);this.focusEle = li;this.mask.ready(ul);this.mask.start();神秘花园网页代码站人间仙境WEB 前端VB 封装一个文本文件读写类含示例Csdn 网站右下角的滑出弹出提示(带关闭功能)VC+做的精美仿 XP 开始菜单VB+Ac
32、cess 学生综合档案管理系统Delphi 随机抽取幸运观众 Access 数据库版 多线程的 VC+高速文件搜索代码源码下载15 个 jQuery 学习实例(菜单、滚动、层隐藏等)VB 取汉字拼音首码(第一个字母)源码VB 多进制转换源程序杰奇网站管理系统 JIEQI CMS v1.7短标题Delphi 版视频监控系统Java2 核心技术卷 2:高级特性第 7 版中文高清 PDF基于 Delphi 的 HIS 自动更新程序 v2.0C#早期开发的摄像头监控系统源码 随机密码生成器 VC+源程序更短C# 酒店管理(SQL2005)云台 C#家庭视频监控系统完整版 VS2008 开发的 C#高校
33、宿舍管理系统C#落雪无痕 IP 端口扫描器 VS2005火狐浏览器 Firefox v3.5new ImgFlash($(“box“);/初始化new Tab($(“tab1“),“mouseover“);-图片的切换二防腾讯网的 JS 图片切换代码 - bodymargin: 0px;A COLOR: #313131;font-size: 9pt; TEXT-DECORATION: noneA:hover COLOR: #d7000f; TEXT-DECORATION: underline.disdisplay:block.undisdisplay:none.npimborder:#000
34、1px solid;.npim1 imgborder:#E5E5E5 3px solid.nptx3padding-left:207px;.nptx3 divwidth:21px; line-height:20px; text-align:center; margin-left:3px; float:left;cursor:pointer;.npfd1background:url(“http:/ no-repeat;.npfd1 a,.npfd1 a:hovercolor:#fff;text-decoration:none;/* */.npfd2background:url(“http:/
35、no-repeat;1234567var n=0;var showNum = document.getElementById(“num“);var fc = document.getElementById(“fc“);var week = new Date().getDay();if(week)week=week-1;elseweek=6;function Mea(value)n=value;setBg(value);plays(value);function setBg(value)for(var i=0;i6)n=0;Mea(n); first=setInterval(“setAuto()“, 5000);Mea(week);网页代码站 - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!