爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
页面中图层飞舞效果
页面中图层飞舞效果
日期:2014-05-18 浏览次数:20123 次
以下是程序代码
<SCRIPT> function morph(e,wait,steps,style,done){ if(e.morphing){ return; } e.morphing = true; e.step = 0; e.done = steps; e.wait = wait; e.morphDone = done; // initialize the given element for the process // save some temporary variables within it var attribs = _eat_attrib(style); if(attribs["top"] != null){ e.deltaTop = Math.round(Number((attribs["top"] - e.style.posTop) / steps)); e.finalTop = attribs["top"]; }else{ e.deltaTop = null; e.finalTop = e.style.posTop; }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 if(attribs["left"] != null){ e.deltaLeft = Math.round(Number((attribs["left"] - e.style.posLeft) / steps)); e.finalLeft = attribs["left"]; }else{ e.deltaLeft = null; e.finalLeft = e.style.posLeft; } if(attribs["height"] != null){ e.deltaHeight = Math.round(Number((attribs["height"] - e.style.posHeight) / steps)); e.finalHeight = attribs["height"]; }else{ e.deltaHeight = null; e.finalHeight = e.style.posHeight; } if(attribs["width"] != null){ e.deltaWidth = Math.round(Number((attribs["width"] - e.style.posWidth) / steps)); e.finalWidth = attribs["width"]; }else{ e.deltaWidth = null; e.finalWidth = e.style.posWidth; } // group all of the coloring elements together e.colors = new Array(); for(attrib in attribs){ // check each one individually to kludge // if we need to use a "safe" name for the css attribute if(attrib == "background"){ e.colors[e.colors.length] = new Array(); e.colors[e.colors.length - 1].name = attrib; e.colors[e.colors.length - 1].safename = attrib; } if(attrib == "color"){ e.colors[e.colors.length] = new Array(); e.colors[e.colors.length - 1].name = attrib; e.colors[e.colors.length - 1].safename = attrib; } if(attrib == "border-color"){ e.colors[e.colors.length] = new Array(); e.colors[e.colors.length - 1].name = attrib; e.colors[e.colors.length - 1].safename = "borderColor"; } } for(var i=0;i<e.colors.length;i++){ var rgb = _eat_rgb(attribs[e.colors[i].name]); var prergb = _eat_rgb(e.style[e.colors[i].safename]); e.colors[i].delta = _eat_rgb(attribs[e.colors[i].name]); e.colors[i].finish = _eat_rgb(attribs[e.colors[i].name]); e.colors[i].delta["red"] = Math.round(Number((rgb["red"] - prergb["red"]) / steps)); e.colors[i].delta["green"] = Math.round(Number((rgb["green"] - prergb["green"]) / steps)); e.colors[i].delta["blue"] = Math.round(Number((rgb["blue"] - prergb["blue"]) / steps)); } // fire the first morphing step setTimeout("_morphing(document.all." + e.id + ")", wait); } //// private function that does the work of morphing the element function _morphing(e){ e.step++; if(e.deltaTop!=null){ e.style.posTop += e.deltaTop; } if(e.deltaLeft!=null){ e.style.posLeft += e.deltaLeft; } if(e.deltaHeight!=null){ e.style.posHeight += e.deltaHeight; } if(e.deltaWidth!=null){ e.style.posWidth += e.deltaWidth; }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 for(var i=0;i<e.colors.length;i++){ var rgb = _eat_rgb(e.style[e.colors[i].safename]); e.style[e.colors[i].safename] = "rgb(" + (e.colors[i].delta["red"] + rgb["red"]) + "," + (e.colors[i].delta["green"] + rgb["green"]) + "," + (e.colors[i].delta["blue"] + rgb["blue"]) + ")"; } // do special things when we are done if(e.step == e.done){ if(e.deltaTop != null) e.style.posTop = e.finalTop; if(e.deltaLeft != null) e.style.posLeft = e.finalLeft; if(e.deltaWidth != null) e.style.posWidth = e.finalWidth; if(e.deltaHeight != null) e.style.posHeight = e.finalHeight; for(var i=0;i<e.colors.length;i++){ e.style[e.colors[i].safename] = "rgb("
上一篇:狡猾的按钮特效
下一篇:鼠标经过链接显示说明信息
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
9158屌丝逆袭 从在线“夜总会”转型KTV
电信设备商淘金中国4G:华为中兴领衔
火一把就死: 百度魔图验证社交游戏衰亡宿命
第二梯队也PK:当1号店“遇上”京东手机节
湘鄂情剥离餐饮业务进军大数据的底气在哪里?
只有切到刚需痛点,漫画APP才能走下去
特斯拉将获上海免费牌照 充电桩面临双重标准
国美在线叫板京东:李俊涛底气在哪?
360涉足搜索范围 百度市场份额面临应战
推荐阅读
更多>
华为变阵:任正非调整三大业务布局
看病也能用支付宝了 马云的又一盘大棋
微软很“捉急”:补贴Win8 重加末尾按钮
携程艺龙联手死磕同程 价钱烽烟蔓延至机票
乐视28日发布手机进展 LeUI系统Mobile版或曝光
SAP高层调整:联席CEO孟鼎铭成唯一掌舵人
为啥苹果定要出廉价iPhone?都是安卓逼的
亚马逊宣布新春大促策略 欲打造另一个"黑五"
亚马逊落户上海自贸区:美国货直邮中国
搜狐与奇虎360或结盟对抗BAT
罗永浩工匠形象坍塌,锤子产能再跳水逃离用户超两成
任正非:华为决不上市 上市公司股东贪婪而短视
传360周鸿祎曾试图阻止百度收购91无线
中方抗议美方限购IT设备 紧张关系加剧
这一次,微软将带给我们什么惊喜?
支付宝被曝严重破绽 隐私平安再受质疑
空气污染器市场乱象丛生 选购需慎重
黑狐病毒疯传播 电脑管家首推 专杀工具
同为70前后人,马云为什么总是像外星人那么瘦
谁说黑莓没救?他们在悄悄地深耕企业级市场,在这个领域,苹果三星算什么,他们远远不是黑莓的对手