1、(function($){ //($)防止$冲突
$.fn.extend({ //jquery方法
check: function() {
return this.each(function() { this.checked = true; });
},
uncheck: function() {
return this.each(function() { this.checked = false; });
}
});
})(jQuery)
2、(function($){ //防止$冲突
jQuery.extend({ //工具方法
min: function(a, b) { return a < b ? a : b; },
max: function(a, b) { return a > b ? a : b; }
});
})(jQuery)
原文:http://www.cnblogs.com/hu-tao/p/6033343.html