长篇的js,可以用什么方法,让它快速的格式规范阿??有什么工具可以用吗?
比如:
var _3=new AJS.fx.Base();
_3.elm=AJS.$(_1);
_3.setOptions(_2);
_3.options.duration=600;
AJS.update(_3,{increase:function(){
if(this.now==7){
_1.style.backgroundColor= "transparent ";
}else{
_1.style.backgroundColor= "# "+AJS.fx._shades[Math.floor(this.now)];
}
}});
return _3.custom(6,0);
},fadeIn:function(_4,_5){
_5=_5||{};
if(!_5.from){
_5.from=0;
AJS.setOpacity(_4,0);
}
if(!_5.to){
_5.to=1;
}
var s=new AJS.fx.Style(_4, "opacity ",_5);
return s.custom(_5.from,_5.to);
},fadeOut:function(_7,_8){
_8=_8||{};
if(!_8.from){
_8.from=1;
}
if(!_8.to){
_8.to=0;
}
_8.duration=300;
var s=new AJS.fx.Style(_7, "opacity ",_8);
return s.custom(_8.from,_8.to);
},setWidth:function(_a,_b){
var s=new AJS.fx.Style(_a, "width ",_b);
return s.custom(_b.from,_b.to);
},setHeight:function(_d,_e){
var s=new AJS.fx.Style(_d, "height ",_e);
return s.custom(_e.from,_e.to);
}};
AJS.fx.Base=new AJS.Class({init:function(){
AJS.bindMethods(this);
},setOptions:function(_10){
this.options=AJS.update({onStart:function(){
},onComplete:function(){
},transition:AJS.fx.Transitions.sineInOut,duration:500,wait:true,fps:50},_10||{});
},step:function(){
var _11=new Date().getTime();
if(_11 <this.time+this.options.duration){
this.cTime=_11-this.time;
this.setNow();
}else{
setTimeout(AJS.$b(this.options.onComplete,this,[this.elm]),10);
this.clearTimer();
this.now=this.to;
}
this.increase();
},setNow:function(){
this.now=this.compute(this.from,this.to);
},compute:function(_12,to){
var _14=to-_12;
return this.options.transition(this.cTime,_12,_14,this.options.duration);
},clearTimer:function(){
clearInterval(this.timer);
this.timer=null;
return this;
},_start:function(_15,to){
if(!this.options.wait){
this.clearTimer();
}
if(this.timer){
return;
}
------解决方案--------------------------------------------------------
utraledit还比较好用
------解决方案--------------------------------------------------------
以前用过eclipse 和 netbeans 都可以规范格式
按下ctrl+shift+f就行了
------解决方案--------------------------------------------------------
楼主这个js不是标准的js吧,这样顶多就是调整下格式罢了
------解决方案--------------------------------------------------------
SourceFormatX 找破解版的。
破解方法:
http://bbs.pediy.com/showthread.php?s=&threadid=33071