//http://www.cnblogs.com/Wayou/p/jquery_plugin_tutorial.html
;(function($) {
$.fn.extend({
robot: function(options) {
//覆盖默认参数
options = $.extend({}, $.Robot.defaults, {
}, options);
return this.each(function() {
new $.Robot(options);
});
}
});
$.Robot = function(options) {
//coding here...
};
//配置默认参数
$.Robot.defaults = {
chatCtn: "#chatCtn", //聊天框
inputCtn: "#inputCtn", //输入框
tipWord: "#tipWord", //输入框的提示文字
sendBtn: "#sendBtn", //输入框的发送按钮
customName: "小黑", //客户的姓名
remainWords: "#remainWords", //剩余文字统计
};
})(jQuery);