爱易网
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 浏览次数:20402 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 第一步:把如下代码加入<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 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:页面的打开移动
下一篇:最简单的页面层
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
苹果6月20日发布iPhone5S 触摸屏概念股生动
韩国研制无线充电系统:一次可充40部手机
途牛开盘价9美元 与发行价持平
全球五大电信设备商业绩:华为净利居首
苹果iWatch或使用量产液态金属 将取代玻璃
网曝富士康“二连跳” 疑因推静音模式
宽带中国战略明确 运营商建设成本超6000亿
传诺基亚5月14日发布会推出Lumia 950
从旗下三大业务BG发展看华为的过去现在和未来
推荐阅读
更多>
9月1日起免征新能源汽车购置税
唯品会荣登“最贵中概股”的欢喜与哀愁
国网公司将加快组建 业界人士称困难重重
中移动财报外的"五座大山":运营商沦为走秀陪衬
《中国三网融合业务运营管理》研讨报告征订函
小米盗版有理激怒乐视:提500部盗播证据猛追打
P2P平台科迅网疑“跑路” 涉及金额超2700万
看,网络文学今日之繁盛;忆,纯真去哪了?
HTC以品牌营销突围 专家建议改变经营思路
阿里巴巴上市后雅虎将面临更大的业绩压力
中国移动4G资费调整方案6月1日起正式实施
惠普董事长莱恩辞职 为巨额财务减记埋单
聚美向左,唯品向右,怎能耐得住高跟和红唇的诱惑!
QQ空间与微信龟兔赛跑,商业生态链陷入死循环
微软很“捉急”:补贴Win8 重加末尾按钮
诺基亚若没加入微软,只不过是另一个HTC而已
传运营商高层将变化 专家称需体制革新
迅雷再次在美提交IPO申请
虚拟运营市场躁动:山西煤老板兴味浓重
HTC的三大迷惘:高管釜底抽薪 产品营销战略混乱