爱易网
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 浏览次数:20337 次
以下是程序代码
<%@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图片切换特效
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
诺基亚培育低端机市场 迂回战术要挟中华酷联
阿朗力避步北电后尘 急切停止自我革新
史上最严电话实名制9月实行 三大难题待解
P2P平台科迅网疑“跑路” 涉及金额超2700万
同样的背景,罗永浩和雷军到底有什么不同?
iPhone 6将于10月17日内地上市:售5288元起
揭秘:阿里巴巴“无人认领”的三成股权都归谁
Android版WhatsApp曝漏洞:聊天记录可被窃取
魅族黄章惹怒芙蓉姐姐 将跨界推女神手机
推荐阅读
更多>
百度吴恩达:图像和音视频搜索是人工智能新方向
国内云服务商存在尴尬:“远程机房+移动大硬盘”模式
全球网络遭史上最大规模攻击:攻击数据每秒300G
迅雷欲3300万美元收购金山快盘 预计9月完成
刘强东:京东上市融资用于开拓三至六线城市
巧用百度推行系统 突显竞价效果
618首日看京东阿里不同策略,鹿死谁手?
Google要求硬件厂商捆绑预装应用的协议曝光
HTC的三大迷惘:高管釜底抽薪 产品营销战略混乱
苹果CEO抱歉解读:是战略而非“屈服”
淘宝公布新规:升级售假卖家惩罚力度
二代 iPad Air将配备2GB内存?为同屏多任务做准备
猎豹移动上市押海外市场 与小米有合作空间
摩托罗拉中国区将再裁员 助力公司变身
三大运营商获通知大减营销费 传3年减400多亿
Line风靡亚洲,在北美却进展缓慢
神州电脑中止IPO面前:再被质疑财务造假
电信设备商淘金中国4G:华为中兴领衔
优酷土豆携手新浪微博 谋攻移动视频失地
美国政府关门可能影响去哪儿等公司IPO