爱易网
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 浏览次数:20383 次
以下是程序代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>很酷的图片伸缩功能 aiyiweb.com</title> </head> <body> 应有尽有的网页特效网址:<a href="http://js.aiyiweb.com">js.aiyiweb.com</a>,好资源一起分享。 <script> var isIE = (document.all) ? true : false; function $(Id){return document.getElementById(Id)}; var CurrentStyle = function(element){return element.currentStyle || document.defaultView.getComputedStyle(element, null);}; var extend = function() { var args = arguments; if(!args[1])args = [this,args[0]]; for(var property in args[1])args[0][property] = args[1][property]; return args[0]; }; var Class = function(properties){ var _class = function(){return (arguments[0] !== null && this.initialize && typeof(this.initialize) == 'function') ? this.initialize.apply(this, arguments) : this;}; _class.prototype = properties; return _class; }; var Tween = { Quintic:{ easeOut: function(t,b,c,d){ return c*((t=t/d-1)*t*t*t*t + 1) + b; } } } var FadeStruct = function(options){ //this.run = false;//是否渐变 this.start = 0;//开始值 //this.end = 0;//结束值 this.target = 0;//当前值 extend(this, options || {}); } var Fade = new Class({ options:{ Opacity: {}, //透明渐变参数 Height : {}, //高度渐变参数 Width : {}, //宽度渐变参数 Top : {}, //Top渐变参数 Left : {}, //Left渐变参数 step : 80, //执行多少次到达目标位置 time : 2, //多少时间执行一次 num : 0, //记录执行了多少次了 show : true //图片一开始是展开的 }, initialize:function(elm){ this.elm = elm; this.timer = null; this.finish = true; this.fun = function(){}; this.original = [parseInt(CurrentStyle(this.elm).width),parseInt(CurrentStyle(this.elm).height),parseInt(CurrentStyle(this.elm).left),parseInt(CurrentStyle(this.elm).top)]; // 记录刚开始时,elm的长 宽 left 和 top this.Height = new FadeStruct(); this.Width = new FadeStruct(); this.Top = new FadeStruct(); this.Left = new FadeStruct(); this.Alpha = new FadeStruct(); this.Opacity= new FadeStruct() /////////////////////////////////////////////////////////////////////////////////////////////////// extend(this.Height,this.options.Height); extend(this.Width,this.options.Width); extend(this.Left,this.options.Left); extend(this.Top,this.options.Top); extend(this.Opacity,this.options.Opacity); extend(this.Alpha,this.options.Alpha); this.step = this.options.step; this.time = this.options.time; this.num = this.options.num; this.show = this.options.show; /////////////////////////////////////////////////////////////////////////////////////////////////// this.fun = function(){this.SetHeight();this.SetWidth();this.SetLeft();this.SetTop();this.SetBorder(),this.SetAlpha()} }, Start:function(){ clearTimeout(this.timer); this.num =0 this.show = !this.show; this.Run(); }, Run:function(){ var self = this; this.num++; this.fun(); if(this.num>this.step) {clearTimeout(this.timer);return;} else { this.timer = setTimeout(function(){self.Run()},this.time)} }, SetHeight:function(){ this.elm.style.height = this.MotoTo(this.num,this.Height.start,this.Height.target,this.step)+'px'; }, SetWidth:function(){ this.elm.style.width = this.MotoTo(this.num,this.Width.start,this.Width.target,this.step)+'px'; }, SetLeft:function(
上一篇:狡猾的按钮特效
下一篇:全面支持火狐与IE的flash图片切换特效
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
盛大游戏走向衰落的根源:免费游戏模式惹的祸
Google要求硬件厂商捆绑预装应用的协议曝光
雷军收买腾讯金山股份:持股比例升至27%
568倍PE,“长跑者”亚马逊的高估值之谜
微软史上最大规模裁员,一半诺基亚员工
支付宝全面封杀比特币:充值码淘宝店或遭封禁
宽带中国战略明确 运营商建设成本超6000亿
HTC曝出特大丑闻:高管诈骗+商业间谍
雷军会做赔钱生意?迅雷跌破发行价 市值仅7亿美元
推荐阅读
更多>
新一代iPhone11月底国内上市 支持TD制式
谷歌董事长成花花公子:情史足以媲美涂鸦
传360周鸿祎曾试图阻止百度收购91无线
国内云服务商存在尴尬:“远程机房+移动大硬盘”模式
打车软件“明补变暗补”背后的小算盘
移动联通回应税率改革:短期内收入利润将大减
App Store严禁推送广告 运用面临大清洗
“合聚变”来了 UC优视确认并入阿里巴巴
三星手机在国内陷入困境:华为中兴小米紧追
“宽带中国”计划已正式上升为国家战略
广电地方营业厅的一句“罚停”,暴露出了他们的本质
揭秘:阿里巴巴“无人认领”的三成股权都归谁
高通拼抢国际芯片市场 联发科海外拓展难安心
挂号网高管团体离任 或因投资人失掉决计
分析称iPhone 6明年初发布 屏幕变为4.8吋
苹果多色彩!葫芦里究竟卖的什么药
中国移动承诺再降4G资费 网络漫游至50个国家
HDS发布《2013中国CIO洞察白皮书》
苹果已经允许开发者提交64位应用程序
FDD牌照12月将发放 联通电信双4G反击中移动