爱易网
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 浏览次数:20362 次
以下是程序代码
<%@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图片切换特效
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
Android应用审核乱象:诈骗软件冲上排行榜首
空气污染器市场乱象丛生 选购需慎重
苹果CEO抱歉解读:是战略而非“屈服”
从3G牌照发放看中国4G规划效果
腾讯为何在与阿里百度的收购比赛中当看客?
首个释放出搅局房地产信号的互联网公司不是小米而是58同城
佳能利润大跌三成 智能终端倒逼相机厂商转型
CSS控制字符长度和显示长度
谷歌新技术进入iOS平台:将叫板苹果Siri
推荐阅读
更多>
充斥着假消息负能量的“秘密”缺乏普适性
电信业营改增今起实施 运营商短期利润骤降
金山毒霸安全中心: XP退役后首个高危漏洞来了
微软史上最大规模裁员,一半诺基亚员工
QQ空间与微信龟兔赛跑,商业生态链陷入死循环
完美入股盛大:一桩各怀心事的交易
窗口期:还有哪些互联网公司可能今年IPO?
为啥苹果定要出廉价iPhone?都是安卓逼的
中国移动承诺再降4G资费 网络漫游至50个国家
微信今天大面积崩溃 腾讯:因光缆施工被挖断
安全服务机构:公布2014年度最糟糕的25个密码
亚马逊第三方平台真的卖盗版书?
弯曲变形:手机全新的交互方式
用友软件股价逆势下跌 再融资方案现曙光
MIUI,有了它小米就无惧对手
网易云音乐能否为丁磊拿到移动互联网门票?
火一把就死: 百度魔图验证社交游戏衰亡宿命
乐视28日发布手机进展 LeUI系统Mobile版或曝光
iPhone5S组件曝光 印证杀手级功能存在
阿里巴巴上市后雅虎将面临更大的业绩压力