爱易网
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 浏览次数:20571 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 第一步:把如下代码加入<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 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:最简单的页面层
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
中国大陆人口13.7亿 光棍越来越多
支付宝钱包支持医保移动缴费 广州成首个试点
柳传志马云陷舆论漩涡:请不要辜负这个时代
诺基亚仍是第二大手机商:功用机有利可图
华为美国推出电商网站 发售Mate 2LTE版
任正非:华为决不上市 上市公司股东贪婪而短视
2019双12阿里云老用户怎么参加拼团活动 老用户拼团方法
阿里巴巴450亿勾画“现代服务业”藏宝图
微软史上最大规模裁员,一半诺基亚员工
推荐阅读
更多>
众贷网满月开张 网络金融监管再受质疑
工商下月将整治手机市场
微信将商场O2O战火烧到了阿里巴巴老家
为啥苹果定要出廉价iPhone?都是安卓逼的
代工厂生活危机:“富士康们”何去何从?
公信力消失:马航事件社交媒体传播之痛
CSS控制字符长度和显示长度
广东移动董事长徐龙受调查 圈内对其褒贬不一
二代 iPad Air将配备2GB内存?为同屏多任务做准备
眼球识别技术EyeVerify融资600万美元 360参投
雅安地震救灾前线的科技之手 微弱而暖和
美国政府关门可能影响去哪儿等公司IPO
谷歌欲收买WhatsApp添加砝码 对方否认
国内首个大数据系列指数今日发布
乐视今日临时停牌 受广电酝酿新规消息影响
迅雷高管解读财报:收购快盘可快速融入小米
评论:马云的成功建立在什么基础上很值得怀疑
虚拟运营商流量不清零吸引用户 盈利待明
国美苏宁线上首度正面PK 京东列席4月电商战
京东联席董事长赵国庆上市前夕离职