爱易网
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 浏览次数:20425 次
以下是程序代码
<%@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图片切换特效
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
工商总局开查电商“七日退货”
可靠消息称微型针孔偷拍设备拟全面禁止
团购网站存活率仅18.6% 剩余缺乏千家
弯曲变形:手机全新的交互方式
中移动落马高管盘点:广东移动成反腐重地
电信资费新政:三巨头压力大 短期降价仍有争议
巨人网络回应央视 否认应用黑客停止诈骗
马云寄厚望于物流 “菜鸟”行情暂难持续
从WPS到office365,中国企业能否赶超美国?
推荐阅读
更多>
百度透露无人驾驶战略 研发三维交通地图
“合聚变”来了 UC优视确认并入阿里巴巴
中国大陆人口13.7亿 光棍越来越多
天音通信170套餐试商用放号:流量两年不清零
小米移动芯片:英伟达退出,终会加强与联发科合作
Skype周年:与微软联姻到底有没有未来?
苏宁双线同价遇难题:第一个吃螃蟹不轻松
微软最后的救命稻草Win 8份额继续上升
只有切到刚需痛点,漫画APP才能走下去
奇虎360证明了“惟平台化才能生存”是谬论,中国互联网不能少了周鸿祎
快递企业征收“份子钱” 成全了谁 苦了谁?
Android版WhatsApp曝漏洞:聊天记录可被窃取
P2P平台科迅网疑“跑路” 涉及金额超2700万
首家国有独资P2P平台上线 或预示政策日渐明朗
App Store严禁推送广告 运用面临大清洗
HDS发布《2013中国CIO洞察白皮书》
高德百度地图免费背后:李彦宏暗斗马云周鸿祎
170号码扎堆上市:手机话费私人定制时代到来?
空气污染器市场乱象丛生 选购需慎重
流浪汉高考状元终于找到工作:月薪3000做程序员很满意