js制作各种功能选项卡
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
* { margin:0; padding:0; border:0; list-style:none; }
body { background:#fff; padding:20px; font:1em Verdana, Geneva,
sans-serif; }
.box { float:left; margin-right:20px; }
.box h4 { color:#c00; line-height:30px; font-size:12px; }
.tip { border:1px solid #dedede; margin-top:20px; }
.tip p { height:30px; line-height:30px; padding-left:16px; background:#f1f1f1; }
.tip pre { background:##AFF8AB; }
.tip2 { font-size:12px; color:#888; margin-top:16px; }
.mF_tab { width:426px; height:90px; margin-left:16px; }
.mF_tab .btn { position:absolute; top:0; left:0; z-index:2; }
.mF_tab .btn li { float:left; width:80px; height:26px; line-height:26px; text-align:center; margin-right:2px; border:1px solid #dedede;
border-bottom:0; cursor:pointer; background:#f1f1f1; }
.mF_tab .btn li.current { height:27px; background:#fff; }
.mF_tab .cont { position:absolute; top:27px; left:0; border:1px solid #dedede; overflow:hidden; }
.mF_tab .cont .swt { position:absolute; left:0; top:0; }
.mF_tab .cont .swt li p { padding:16px; }
var myFocus={
$:function(id){return document.getElementById(id);},
$$:function(tag,obj){return (typeof
obj=='object'?obj:this.$(obj)).getElementsByTagName(tag);},
$$_:function(tag,obj){
var arr=[],n=0,a=obj.getElementsByTagName(tag);
for(var i=0;i arr.push(a[i]); if(a[i].getElementsByTagName(tag).length){n=a[i].getElementsByTagNa me(tag).length} i=i+n;n=0; } return arr; }, $li:function(obj,n){return this.$$_('li',this.$$_('ul',obj)[n])}, linear:function(t,b,c,d){return c*t/d + b;}, easeIn:function(t,b,c,d){return c*(t/=d)*t*t*t + b;}, easeOut:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t - 1) + b;}, easeInOut:function(t,b,c,d){return ((t/=d/2) < 1)?(c/2*t*t*t*t + b):(-c/2*((t-=2)*t*t*t - 2) + b);}, style:function(obj,style){return obj['offset'+style.replace(/^(.)/,new Function('return arguments[1].toUpperCase()'))];}, opa:function(obj,v){ if(v!=undefined) {v=v>100?100:(v<0?0:v); obj.style.filter = "alpha(opacity=" + v + ")"; obj.style.opacity = (v / 100);} else return (!+[1,])?((obj.filters.alpha)?obj.filters.alpha.opacity:100):((obj.st yle.opacity)?obj.style.opacity*100:100); }, animate:function(obj,prop,val,spd,type,fn){ var opa=prop=='opacity'?true:false; if(opa&&obj.style.display=='none'){obj.style.display='';this.opa(ob j,0);} var t=0,b=opa?this.opa(obj):parseInt(this.style(obj,prop)),c=val-b,d=spd| |50,st=type||'easeOut',m=c>0?'ceil':'floor'; if(obj[prop+'Timer']) clearInterval(obj[prop+'Timer']); obj[prop+'Timer']=setInterval(function(){ if(opa&&t if(!opa&&t {if(opa&&val==0){obj.style.display='none'}clearInterval(obj[prop+'Tim er']);fn&&fn.call(obj);} },10);return this; }, fadeIn:function(obj,speed,fn){this.animate(obj,'opacity',100,speed== undefined?20:speed,'linear',fn);return this;}, fadeOut:function(obj,speed,fn){this.animate(obj,'opacity',0,speed==u ndefined?20:speed,'linear',fn);return this;}, slide:function(obj,params,speed,easing,fn){for(var p in params) this.animate(obj,p,params[p],speed,easing,fn);return this;}, stop:function(obj){ var animate=['left','right','top','bottom','width','height','opacity']; for(var i=0;i return this; }, initCSS:function(p){