Sure... Just save a reference to the existing function, and call it:
(function($)
{
// maintain a reference to the existing function
var oldcss = $.fn.css;
// ...before overwriting the jQuery extension point
$.fn.css = function()
{
// original behavior - use function.apply to preserve context
var ret = oldcss.apply(this, arguments);
// stuff I will be extending
// that doesn't affect/change
// the way .css() works
// preserve return value (probably the jQuery object...)
return ret;
};
})(jQuery);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…