Reputation: 3698
I have a plugin that does:
$(window).resize(setOverlayHeight)
.resize(setSelfPosition)
and I cant remove it in the main js code...
I have tried:
$(window).off("resize", "setOverlayHeight");
and
$(window).unbind('resize', 'setSelfPosition');
Have I done anything wrong?
Upvotes: 0
Views: 199
Reputation: 123739
You need to pass the function reference, not a string.
$(window).off("resize", setOverlayHeight);
In order to remove all event bindings on window you can just do:
$(window).off();
Upvotes: 2