爱易网
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 浏览次数:20614 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 第一步:把如下代码加入<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 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:最简单的页面层
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
9月1日起免征新能源汽车购置税
Twitter收购印度手机营销公司ZipDial
雅安地震 绝不宽恕应用人们爱心的骗子!
小米发明的“低价抢购”模式还能管用多久?
扎克伯格华裔妻子首度亮相电视节目畅谈情史
罗永浩工匠形象坍塌,锤子产能再跳水逃离用户超两成
总部大楼已换微软Logo:回忆诺基亚的兴衰史
“论文查重”网店一月收入竟过百万
CSS控制字符长度和显示长度
推荐阅读
更多>
NoomWeight减肥
联发科享用价钱战 专利难以摆脱高通
打车App就是下一个团购骗局!?
App Store严禁推送广告 运用面临大清洗
三星已经将Galaxy S5视为失败之作?
做大电影,阿里控股公司在港成立影业集团
诺基亚培育低端机市场 迂回战术要挟中华酷联
韩国研制无线充电系统:一次可充40部手机
百度透露无人驾驶战略 研发三维交通地图
首个释放出搅局房地产信号的互联网公司不是小米而是58同城
不提老罗,不说情怀,仅从十四个投诉问题入手谈锤子手机
华为、小米和联想在中国手机市场上演“三国杀”
同样的背景,罗永浩和雷军到底有什么不同?
中移动一季度净利大降:手机补贴增长过快
创维冲击500亿梦想:转型硬件和内容供应商
广东移动高层受调查 中移动或现更大反腐风暴
打车软件“明补变暗补”背后的小算盘
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
途牛开盘价9美元 与发行价持平
苹果30亿美元收购Beats