我編寫的插件代碼如下(function (window, document, Math) { var MyPlugin = function(ele,options){ this.element = ele; this.defaults = { 'anime' : true, 'callback' : { 'after' : '', 'before' : '' } }; this.opts = $.extend({},this.defaults,options); } MyPlugin.prototype = { Start:function(){ console.log('start'); return true; } }})(window, document, Math);我使用var MP = new Myplugin();會一直提示ReferenceError: Can't find variable: Myplugin怎么辦,是我哪里寫錯了嗎..
請問如何編寫一個面向對象的jQuery插件?
飲歌長嘯
2018-09-04 13:42:39