已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
超酷超绚精美图片展示效果代码(三)相关图片自己下载,所有的图片路径都是类似 /jscode/images/xxxxx.jpg 这样的形式超酷超绚精美图片展示效果代码(三) - 网页特效观止-网页特效代码|JsCode.CN|html overflow: hidden;body margin: 0px;padding: 0px;background: #000;position: absolute;width: 100%;height: 100%;cursor: crosshair;#diapoContainer position: absolute;left: 10%;top: 10%;width: 80%;height: 80%;background: #222;overflow: hidden;.imgDC position: absolute;cursor: pointer;border: #000 solid 2px;filter: alpha(opacity=90);opacity: 0.9;visibility: hidden;.spaDC position: absolute;filter: alpha(opacity=20);opacity: 0.2;background: #000;visibility: hidden;.imgsrc position: absolute;width: 120px;height: 67px;visibility: hidden;margin: 4%;#bkgcaption position: absolute;bottom: 0px;left: 0px;width: 100%;height: 6%;background:#1a1a1a;#caption position: absolute;font-family: arial, helvetica, verdana, sans-serif;white-space: nowrap;color: #fff;bottom: 0px;width: 100%;left: -10000px;text-align: center;var xm;var ym;/* = onmousemove event = */document.onmousemove = function(e)if(window.event) e=window.event;xm = (e.x | e.clientX);ym = (e.y | e.clientY);/* = window resize = */function resize() if(diapo)diapo.resize();onresize = resize;/* = opacity = */setOpacity = function(o, alpha)if(o.filters)o.filters.alpha.opacity = alpha * 100; else o.style.opacity = alpha;/* = encapsulate script = */diapo = O : ,DC : 0,img : 0,txt : 0,N : 0,xm : 0,ym : 0,nx : 0,ny : 0,nw : 0,nh : 0,rs : 0,rsB : 0,zo : 0,tx_pos : 0,tx_var : 0,tx_target : 0,/ script parameters /attraction : 2,acceleration : .9,dampening : .1,zoomOver : 2,zoomClick : 6,transparency : .8,font_size: 18,/* = diapo resize = */resize : function()with(this)nx = DC.offsetLeft;ny = DC.offsetTop;nw = DC.offsetWidth;nh = DC.offsetHeight;txt.style.fontSize = Math.round(nh / font_size) + px;if(Math.abs(rs-rsB)100) for(var i=0; iN; i+) Oi.resize();rsB = rs;,/* = create diapo = */CDiapo : function(o)/* = init variables = */this.o = o;this.x_pos = this.y_pos = 0;this.x_origin = this.y_origin = 0;this.x_var = this.y_var = 0;this.x_target = this.y_target = 0;this.w_pos = this.h_pos = 0;this.w_origin = this.h_origin = 0;this.w_var = this.h_var = 0;this.w_target = this.h_target = 0;this.over = false;this.click = false;/* = create shadow = */this.spa = document.createElement(span);this.spa.className = spaDC;diapo.DC.appendChild(this.spa);/* = create thumbnail image = */this.img = document.createElement(img);this.img.className = imgDC;this.img.src = o.src;this.img.O = this;diapo.DC.appendChild(this.img);setOpacity(this.img, diapo.transparency);/* = mouse events = */this.img.onselectstart = new Function(return false;);this.img.ondrag = new Function(return false;);this.img.onmouseover = function()diapo.tx_target=0;diapo.txt.innerHTML=this.O.o.alt;this.O.over=true;setOpacity(this,this.O.click?diapo.transparency:1);this.img.onmouseout = function()diapo.tx_target=-diapo.nw;this.O.over=false;setOpacity(this,diapo.transparency);this.img.onclick = function() if(!this.O.click)if(diapo.zo & diapo.zo != this) diapo.zo.onclick();this.O.click = true;this.O.x_origin = (diapo.nw - (this.O.w_origin * diapo.zoomClick) / 2;this.O.y_origin = (diapo.nh - (this.O.h_origin * diapo.zoomClick) / 2;diapo.zo = this;setOpacity(this,diapo.transparency); else this.O.click = false;this.O.over = false;this.O.resize();diapo.zo = 0;/* = rearrange thumbnails based on imgsrc images position = */this.resize = function ()with (this) x_origin = o.offsetLeft;y_origin = o.offsetTop;w_origin = o.offsetWidth;h_origin = o.offsetHeight;/* = animation function = */this.position = function ()with (this) /* = set target position = */w_target = w_origin;h_target = h_origin;if(over)/* = mouse over = */w_target = w_origin * diapo.zoomOver;h_target = h_origin * diapo.zoomOver;x_target = diapo.xm - w_pos / 2 - (diapo.xm - (x_origin + w_pos / 2) / (diapo.attraction*(click?10:1);y_target = diapo.ym - h_pos / 2 - (diapo.ym - (y_origin + h_pos / 2) / (diapo.attraction*(click?10:1); else /* = mouse out = */x_target = x_origin;y_target = y_origin;if(click)/* = clicked = */w_target = w_origin * diapo.zoomClick;h_target = h_origin * diapo.zoomClick;/* = magic spring equations = */x_pos += x_var = x_var * diapo.acceleration + (x_target - x_pos) * diapo.dampening;y_pos += y_var = y_var * diapo.acceleration + (y_target - y_pos) * diapo.dampening;w_pos += w_var = w_var * (diapo.acceleration * .5) + (w_target - w_pos) * (diapo.dampening * .5);h_pos += h_var = h_var * (diapo.acceleration * .5) + (h_target - h_pos) * (diapo.dampening * .5);diapo.rs += (Math.abs(x_var) + Math.abs(y_var);/* = html animation = */with(img.style)left = Math.round(x_pos) + px;top = Math.round(y_pos) + px;width = Math.round(Math.max(0, w_pos) + px;height = Math.round(Math.max(0, h_pos) + px;zIndex = Math.round(w_pos);with(spa.style)left = Math.round(x_pos + w_pos * .1) + px;top = Math.round(y_pos + h_pos * .1) + px;width = Math.round(Math.max(0, w_pos * 1.1) + px;height = Math.round(Math.max(0, h_pos * 1.1) + px;zIndex = Math.round(w_pos);,/* = main loop = */run : function()diapo.xm = xm - diapo.nx;diapo.ym = ym - diapo.ny;/* = caption anim = */diapo.tx_pos += diapo.tx_var = diapo.tx_var * .9 + (diapo.tx_target - diapo.tx_pos) * .02;diapo.txt.style.left = Math.round(diapo.tx_pos) + px;/* = images anim = */for(var i in diapo.O) diapo.Oi.position();/* = loop = */setTimeout(diapo.run();, 16);,/* = load images = */images_load : function()/ = loop until all images are loaded =var M = 0;for(var i=0; idiapo.N; i+) if(plete) diapo.imgi.style.position = relative;diapo.Oi.img.style.visibility = visible;diapo.Oi
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 公卫考试试卷(含答案)
- 国际噪声控制工程学会作业场所噪声限值报告培训
- 桥梁施工安全技术交底培训
- 钢筋套丝机安全技术交底培训课件
- 塔式起重机常见安全事故及其预防培训课件
- 管道基础及管节安装施工安全措施培训
- 危化品企业安全承诺公告研判机制标准培训
- 2025-2026学年湖南株洲醴陵市一中高二下学期期末语文试卷含答案
- HLK自动灭火装置在小型化工企业火灾中的应用培训
- (2026年)幼儿园食品安全日管控周排查月调度制度
- 2026年秋季七年级生物上册苏教版教学计划
- 化工园区公共管廊钢结构工程竣工验收报告
- 河北省2026中考语文作文真题解读及范文
- 2026年养老机构管理人员综合能力测试题
- 数据中心运维管理SOP文件
- 《外婆的澎湖湾》课件2025-2026学年湘艺版三年级下册音乐
- 8D报告培训教材
- 《网络与新媒体营销》课件 第四章 新媒体营销思维
- 防范鼠疫应急预案(3篇)
- 产后伤口感染预防
- 五年(2021-2025)中考数学真题分类汇编(新疆专用)18:圆(学生版)
评论
0/150
提交评论