AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## jquery封装 ``` ;(function($){ //插件分为三种类型: //1、封装对象方法的插件 $.fn.extend({ //ste1:设置字体的颜色 "color": function(value){ return this.css("color", value); } }); //example: $('.a).css('#FF0000'); //2、封装全局函数的插件 $.extend({ ltrim : function(text) { return (text || "").replace( /^\s+/g, ""); }, rtrim : function (text) { return (text || "").replace( /\s+$/g, ""); } }); //example: $.ltrim(" test "); //3、选择器插件 $.extend($.expr[":"], { between : function(a,i,m) { var tmp = m[3].split(","); //将传递进来的m[3]以逗号为分隔符,转成一个数组 return tmp[0]-0<i&&i<tmp[1]-0; } }) //example:$("div:between(2,5").css("background","white"); })(jQuery); ```