Is it possible to add an observer to a DOM element that is triggered on changes to the visibility (i.e. calls to show() and hide())? Thanks!
Is it possible to add an observer to a DOM element that is triggered
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to observe any call to
.show()or.hide()and have access to jQuery 1.5+ you could usejQuery.sub()to create a copy of the jQuery object to override the default.show()or.hide()actions.And then using the
.sub()copyExample on jsfiddle