I want to override jQuery's hide()
function on my object. I want it to call my onHide()
function and then call original hide()
.
How to accomplish this?
The simplest code won't pass parameters I guess:
myobject.oldhide = myobject.hide;
myobject.onHide = function() {
// something
};
myobject.hide = function() {
this.onHide();
this.oldhide();
}
jQuery's hide()
accepts up to 3 parameters. Can I just define 3 of them?
myobject.oldhide = myobject.hide;
myobject.onHide = function() {
// something
};
myobject.hide = function(a,b,c) {
this.onHide();
this.oldhide(a,b,c);
}