Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(window, $, undefined){
- /**
- * Hooks into a given method
- *
- * @param method
- * @param fn
- */
- $.fn.hook = function (method, fn) {
- var def = $.fn[method];
- if (def) {
- $.fn[method] = function() {
- var r = def.apply(this, arguments); //original method
- fn(this, method, arguments); //injected method
- return r;
- }
- }
- }
- })(window, jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement