爱易网
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 浏览次数:20562 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 第一步:把如下代码加入<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 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:最简单的页面层
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
中电信国际漫游费下调85% 世界杯上网28元/天
途牛旅游网今晚挂牌纳斯达克 融资1亿美元
聚美向左,唯品向右,怎能耐得住高跟和红唇的诱惑!
HTC与苹果三星距离扩展 C2B形式成新武器
银河证券王锦炎:金融业如何使用大数据
空气污染器市场乱象丛生 选购需慎重
揭秘:阿里巴巴“无人认领”的三成股权都归谁
靠谱分析:6月发生的WWDC和谷歌I/O大会,将会出现哪些新产品?
打车软件竞争白热化:有冷兵器时代意味
推荐阅读
更多>
NEC拟出售移动效劳子公司NEC Mobile
解读苹果收购Beats背后动机:库克在想什么?
迅雷再次在美提交IPO申请
火狐手机发展前路:或被运营商绑架
HTC曝出特大丑闻:高管诈骗+商业间谍
FDD牌照12月将发放 联通电信双4G反击中移动
眼球识别技术EyeVerify融资600万美元 360参投
Twitter收购印度手机营销公司ZipDial
代工厂生活危机:“富士康们”何去何从?
唯品会荣登“最贵中概股”的欢喜与哀愁
谁说黑莓没救?他们在悄悄地深耕企业级市场,在这个领域,苹果三星算什么,他们远远不是黑莓的对手
据消息传百度将要控股携程 整合去哪儿
中移动本月推手机钱包 iPhone遭边缘化
京东很忙:升服务推产品更新招股书 能赶在阿里前上市?
说说这一个月的赌球输了多少
屌丝程序猿发家机会来了 用大数据来做生意!
谷歌新技术进入iOS平台:将叫板苹果Siri
OPPO创始人陈明永:我们是怎么做营销的
京东确定IPO定价区间 最高募资16.9亿美元
金山毒霸安全中心: XP退役后首个高危漏洞来了