请注意example2.html 在firefox下效果没有在ie下圆润,其原因来源于兼容性.
以及触发动作过快会导致每一个li递增两次到三次的情况,这个原因跟类(action.js)本身无关.原因来源于example2.html中的演示代码.
目前正在极力修改中.
咨询改版升级信息请关注 我的blog
http://auntion.blogbus.com
或者加我qq询问:82874972
action.js
复制代码 代码如下:
/*
*
效果类
by auntion
qq:82874972
blog:auntion@blogbus.com
email:auntion@gmail.com
版权没有,随便使用.
使用时请勿删除此部分注释.谢谢!
*
*/
showhide = class.create();showhide.prototype = {status: exprs={},initialize: function(ob,endw,endh,effect,step){this.element=(typeof(ob)=='object') ? ob : $id(ob);if(exprs[ob.id]==null){ exprs[ob.id] = true; }if(exprs[ob.id]){this.width=this.element.offsetwidth;this.height=this.element.offsetheight;this.endw=(endw != null)?endw.iszero():null;this.endh=(endh != null) ? endh.iszero():null;this.effect=(effect!=null)?effect:0;this.step=(step!=null)?step:0.075;this.now=[0,0];this.trybug=this.step;this.method,this.goto;exprs[this.element.id]=false;this.start();}},start: function(){switch(this.effect){case 0:{var method = this.judgment();this.base(method);}break;case 1:{var method = this.judgment();this.alpha(method);}break;default:{alert(错误: 不是一个可用的效果! 应为0和1,默认执行0);var method = this.judgment();this.base(method);}}},base: function(method){this.element.style.overflow = hidden;this.goto = this.create(method);},alpha: function(method,step,opacity){alert(未完成的效果,自动用默认效果替代.);this.goto = this.base(method);},allis: function(){this.now[0] += this.expressions(0,this.endw,this.now[0],this.step);this.now[1] += this.expressions(0,this.endh,this.now[1],this.step);if((this.width > this.endw) ? (this.now[0] > (this.endw+this.trybug)) : (this.now[0] this.endh)? (this.now[1] > (this.endh+this.trybug)) : (this.now[1] this.endw) ? (this.now > (this.endw+this.trybug)) : (this.now this.endh) ? (this.now > (this.endh+this.trybug)) : (this.now
language.js
复制代码 代码如下:
/*
*
语言扩展包
by auntion
qq:82874972
blog:auntion@blogbus.com
email:auntion@gmail.com
版权没有,随便使用.
使用时请勿删除此部分注释.谢谢!
*
*/
var class={create: function() {return function() {this.initialize.apply(this, arguments);}}};$id = function(i){return document.getelementbyid(i);};$name = function(i){return document.getelementsbyname(i);};$class = function(classname,baseid) {var fatherid = null;if(!baseid){fatherid = document;}else{var id = baseid;fatherid = $id(id);}var basic = fatherid.getelementsbytagname('*') || document.all;var child = null;var classnames = null;var aggregate = []; for (var i = 0; i
example.html
复制代码 代码如下:
nbsp;html public -//w3c//dtd xhtml 1.0 transitional//en http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd>
example1
恢复初始值
隐藏
宽 + 30
高 + 30
宽 - 30
高 - 30
宽600,高100