爱易网
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 浏览次数:20359 次
以下是程序代码
<%@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图片切换特效
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
巧用百度推行系统 突显竞价效果
SAP高层调整:联席CEO孟鼎铭成唯一掌舵人
首个释放出搅局房地产信号的互联网公司不是小米而是58同城
京东进驻微信一级入口或影响自身战略布局
网易云音乐能否为丁磊拿到移动互联网门票?
充斥着假消息负能量的“秘密”缺乏普适性
百度透露无人驾驶战略 研发三维交通地图
欧盟控诉苹果在爱尔兰非法进行税收交易
淘宝公布新规:升级售假卖家惩罚力度
推荐阅读
更多>
中移动落马高管盘点:广东移动成反腐重地
虚拟运营市场躁动:山西煤老板兴味浓重
苹果多色彩!葫芦里究竟卖的什么药
苹果联合创始人炮轰鲍尔默“一直都在吃老本”
从百度世界大会看大数据
FB上广告费用昂贵而且效果不及Twitter
余额宝收益率跌破5% 银行系宝宝收益率赶超
黑狐病毒疯传播 电脑管家首推 专杀工具
传诺基亚Lumia928下月推出 将与iPhone5看齐
百视通:Xbox One汉化获批 游戏迷欢呼吧
同样的背景,罗永浩和雷军到底有什么不同?
论:三大运营商运用商店逆袭并非不能够
乐视28日发布手机进展 LeUI系统Mobile版或曝光
迅雷欲3300万美元收购金山快盘 预计9月完成
智能手机:中国手机市场最受关注十五款产品清点
地图导航骤起杀机 百度高德重新定义商业模式
湘鄂情剥离餐饮业务进军大数据的底气在哪里?
刘强东向总理建言:打击有组织有规模的售假商家
华为野心布局未来:投资研发5G对赌1毫秒连接
孙正义入股阿里往事还原:阿里巴巴并非软银首选