爱易网
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 浏览次数:20590 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 第一步:把如下代码加入<body>区域中 <script type="text/javascript"> function resizeWin(maxX,maxY,speed,delay,win){ this.obj = "resizeWin" + (resizeWin.count++); eval(this.obj + "=this"); if (!win) this.win = self; else this.win = eval(win); if (!maxX) this.maxX = 400; else this.maxX = maxX; if (!maxY) this.maxY = 300; else this.maxY = maxY; if (!speed) this.speed = 1/7; else this.speed = 1/speed; if (!delay) this.delay = 30; else this.delay = delay; this.doResize = (document.all || document.getElementById); this.stayCentered = false; this.initWin = function(){ if (this.doResize){ this.resizeMe(); } else { this.win.resizeTo(this.maxX + 10, this.maxY - 20); } } this.resizeMe = function(){ this.win.focus(); this.updateMe(); } this.resizeTo = function(x,y){ this.maxX = x; this.maxY = y; this.resizeMe(); } this.stayCentered = function(){ this.stayCentered = true; } this.updateMe = function(){ this.resizing = true; var x = Math.ceil((this.maxX - this.getX()) * this.speed); var y = Math.ceil((this.maxY - this.getY()) * this.speed); if (x == 0 && this.getX() != this.maxX) { if (this.getX() > this.maxX) x = -1; else x = 1; } if (y == 0 && this.getY() != this.maxY){ if (this.getY() > this.maxY) y = -1; else y = 1; } if (x == 0 && y == 0) { this.resizing = false; } else { this.win.top.resizeBy(parseInt(x),parseInt(y)); if (this.stayCentered == true) this.win.moveTo((screen.width - this.getX()) / 2,(screen.height - this.getY()) / 2); setTimeout(this.obj + '.updateMe()',this.delay) } } this.write = function(text){ if (document.all && this.win.document.all["coords"]) this.win.document.all["coords"].innerHTML = text; else if (document.getElementById && this.win.document.getElementById("coords")) this.win.document.getElementById("coords").innerHTML = text; } this.getX = function(){ if (document.all) return (this.win.top.document.body.clientWidth + 10) else if (document.getElementById) return this.win.top.outerWidth; else return this.win.top.outerWidth - 12; } this.getY = function(){ if (document.all) return (this.win.top.document.body.clientHeight + 29) else if (document.getElementById) return this.win.top.outerHeight; else return this.win.top.outerHeight - 31; } this.onResize = function(){ if (this.doResize){ if (!this.resizing) this.resizeMe(); } } return this; } resizeWin.count = 0; </script> <script type="text/javascript"> <!-- booyah = new resizeWin(400,300); //(width, height) booyah.stayCentered(); //--> </script> 第二步:把<body>中的内容改为: <body onLoad="booyah.initWin()" onResize="booyah.onResize()"> <a href="http://www.aiyiweb.com/js/">欢迎访问爱易网JS特效</a>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:最简单的页面层
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
搜狐与奇虎360或结盟对抗BAT
团购网站存活率仅18.6% 剩余缺乏千家
雅安地震救灾前线的科技之手 微弱而暖和
苹果联合创始人炮轰鲍尔默“一直都在吃老本”
小米2S试水高端化 纯“性价比”玩法已成过去式
新一代iPhone11月底国内上市 支持TD制式
华为变阵:任正非调整三大业务布局
苹果6月20日发布iPhone5S 触摸屏概念股生动
三星维修新规:Galaxy S4主板进水也收费修
推荐阅读
更多>
摩托罗拉移动裁员关闭德州Moto X手机工厂
特斯拉技术专利开放,要革自己的命?
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
独立工具APP:为亿级用户的商业化而愁
携程收买酷讯成定局:转型互联网+投资
魅族黄章惹怒芙蓉姐姐 将跨界推女神手机
微软张亚勤趋势判断:未来三十年属于物理化互联网
FB上广告费用昂贵而且效果不及Twitter
打车软件竞争白热化:有冷兵器时代意味
清点:罗永浩推锤子ROM 小米打法遭模拟
美图手机2问世 三大问题令其市场销量堪忧
中移动一季度净利大降:手机补贴增长过快
2013年至今中国互联网行业十大并购案汇总
孙正义入股阿里往事还原:阿里巴巴并非软银首选
评论:阿里为什么不试着收购一家香港媒体呢
微软提示XP只剩365天寿命:用户被绑架?
iPhone5S组件曝光 印证杀手级功能存在
联发科享用价钱战 专利难以摆脱高通
新浪微博推粉丝头条功能 意欲与大号分成
欧洲6万人起诉Facebook隐私侵权