大佬教程收集整理的这篇文章主要介绍了jquery – 使用.proxy()调用插件方法,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
(function($) { var setTings = { } var methods = { init: function(options) { alert('init fired'); $.proxy(methods.strobe,this); return this; },destroy: function() { },strobe: function(){ alert('strobe fired'); },show: function() {},hide: function() {},refresh: function() {} }; $.fn.notify = function(method) { if (methods[method]) { return methods[method].apply(this,Array.prototype.slice.call(arguments,1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this,arguments); } else { $.error('Method ' + method + ' does not exist on jQuery.notify'); } }; })(jQuery); $().notify();
我有这个jsfiddle进行测试:http://jsfiddle.net/CZqFW/
任何输入将不胜感激.
以上是大佬教程为你收集整理的jquery – 使用.proxy()调用插件方法全部内容,希望文章能够帮你解决jquery – 使用.proxy()调用插件方法所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。