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

jquery 的 $.extend 和 $.fn.extend

时间:2017-02-24 10:52:36      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:color   function   div   his   logs   load   blog   this   query   

        $.extend({ 
           add:function(a,b){return a+b;},
            bad:function(a,b){return a-b;}
        }); 
        $.fn.extend({
            loading:function(flg){
                if(flg){
                    $(this).show();
                }else{
                    $(this).hide();
                }
            }
        })
        console.log($.add(3,4));
        console.log($.bad(3,4));
        $(#div).loading(false);

 

jquery 的 $.extend 和 $.fn.extend

标签:color   function   div   his   logs   load   blog   this   query   

原文地址:http://www.cnblogs.com/bruce-gou/p/6437421.html

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