$.extend({ add:function(a,b){return a+b;}, bad:function(a,b){return a-b;} }); $.fn.extend({ loading:function(flg){ if(flg){ $(this).show(); }else{ $(this).hide(); } } }) console.log($.add(3,4)); console.log($.bad(3,4)); $(‘#div‘).loading(false);
时间: 2024-10-07 04:22:49