码迷,mamicode.com
首页 > Web开发 > 详细

扩展jQuery的方法

时间:2017-08-26 15:11:57      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:执行函数   style   err   xtend   find   turn   func   error   nbsp   

 

备忘用的:

 

(function ($) {
    $.extend($.fn, {
        clearError : function () {
            if (this.parent("span").length > 0) {
                this.removeClass("validError").parent("span").find("label.error").remove();
            } else {
                this.removeClass("validError").parent("div").find("label.error").remove();
            }
            return this;
        }
    });
})(jQuery);

 

其实里面东西挺多, 立即执行函数, 对象表示法等等;

扩展jQuery的方法

标签:执行函数   style   err   xtend   find   turn   func   error   nbsp   

原文地址:http://www.cnblogs.com/voctrals/p/7435250.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!