$(function(){
// $.extend()拓展方法:
$.extend({
backgroundColor:function(){
$('body').css('background','#ccc');
}
})
$.backgroundColor();//----->就可以调用;
})
$(function(){
// $.fn.extend() jq对象的拓展方法:
$.fn.extend({
color:function(){
$(this).css('color','red');
},
bg:function(){
$(this).css('background','red');
}
})
$('#txt').bg();//----->就可以调用;
})