-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.

0

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I was just about to write this out by hand, not knowing that solution existed.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.