美文网首页
jQuery插件开发

jQuery插件开发

作者: DJMG | 来源:发表于2017-04-14 16:13 被阅读0次

$.extend : 扩展工具方法下的插件形式  $.xxx() ;

$.fn.extend  :  扩展到JQ对象下的插件形式  $(selector).xxx();

$.extend({

        aaa : function(){

                alert(1);

        }

});

$.fn.extend({

        aaa : function(){

                alert(2);

        }

});

$.aaa();                //1

$(selector).aaa(); //2

相关文章

网友评论

      本文标题:jQuery插件开发

      本文链接:https://www.haomeiwen.com/subject/iuowattx.html