Nevermind. I realize the above solution is overkill. I really only need to alter show and hide since they are called at some point in all the other methods.
Now the issue is that unless a speed is given, the callback is not called. This is really only an issue for the hide method since I need to set visibility to hidden after the animation is finished.
Here is the current state:
- var _hide = $.fn.hide;
- var _show = $.fn.show;
- $.fn.extend({
- hide: function(speed, callback) {
- return _hide.call(this, speed, function() {
- callback && callback();
- $(this).css('visibility', 'hidden');
- });
- },
- show: function(speed, callback) {
- $(this).css('visibility', 'visible');
- return _show.call(this, speed, callback);
- }
- });