I’m using a plugin on a website that I’d like to keep completely intact, so that I can reuse the code etc as it develops and for my customisations to be kept clear of the actual functionality.
In this plugin, the fadeOut function is called and given a callback:
jQuery('a').fadeOut(function () { ... });
This is within a click function:
jQuery('p').click(function () {
...other code...
jQuery('a').fadeOut(function () { ... });
}
I want to be able to override the fadeOut function
Is this possible? Or should I be overriding the click functionality completely?
Yes you can prevent future events from happening, and since you don’t want to edit the original code, simply have your
eventand at the end of it stop future ones from propogating.You’re going to have to override the entire click function since the hover is buried inside of it (at least I think so, since I can’t see all.