-1

Is it possible add some function to jquery functions like hide() or show()? The objective is always that I use the function hide(), it will execute jquery base and my own function. If yes, can you show me how? Thanks.

Robusto
  • 30,482
  • 8
  • 54
  • 76
oteal
  • 556
  • 2
  • 12
  • 25

1 Answers1

2

You could override the function. Check Override jQuery functions for a more detailed answer.

Edit: jQuery.fn.show = function() { // Your custom code }

But I wouldn't override jQuery's methods when you could create your own. Overriding would very likely cause unexpected behavior in plugins.

Community
  • 1
  • 1
GuyT
  • 4,075
  • 2
  • 15
  • 29