jq封装插件

$(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();//----->就能够调用;
})
相关文章
相关标签/搜索