首页 > jquery.x=function(a,b,c,d,event){} 能解释下方法写法么?

jquery.x=function(a,b,c,d,event){} 能解释下方法写法么?

求解 jquery.x=function(a,b,c,d,event){}
理解方法的意思,但是不理解为什么可以这么写。
例如:
jQuery.fold = function(obj,obj_c,speed,obj_type,Event){

if(obj_type == 2){
    $(obj+":first").find("b").html("-");
    $(obj_c+":first").show();
}            
$(obj).on(Event,function(){
    if($(this).next().is(":visible")){
        if(obj_type == 2){
            return false;
        }else{
            $(this).next().slideUp(speed).end().removeClass("selected");
            if($(this).find("b")){
                $(this).find("b").html("+");
            }
        }
    }
    else{
        if(obj_type == 3){
            $(this).next().slideDown(speed).end().addClass("selected");
            if($(this).find("b")){
                $(this).find("b").html("-");
            }
        }else{
            $(obj_c).slideUp(speed);
            $(obj).removeClass("selected");
            if($(this).find("b")){
                $(obj).find("b").html("+");
            }
            $(this).next().slideDown(speed).end().addClass("selected");
            if($(this).find("b")){
                $(this).find("b").html("-");
            }
        }
    }
});

}


这是给jQuery拓展方法吧。
jquery.x=function(a,b,c,d,event){}就是拉姆达表达式,
函数里面就是各种判断加DOM操作啊

【热门文章】
【热门文章】