Comments on: Passing a function to jQuery’s CSS() method https://j11y.io/snippets/passing-function-to-jquery-css-method/ Sun, 22 Mar 2015 15:39:22 +0000 hourly 1 https://wordpress.org/?v=5.0.13 By: Balazs Endresz https://j11y.io/snippets/passing-function-to-jquery-css-method/#comment-341 Wed, 31 Dec 2008 10:46:27 +0000 https://j11y.io/?p=305#comment-341 And I thought jQuery can’t be more simple. Very nice!

Only some minor remarks:

It’s much faster if you use simple type checking, $.isFunction isn’t that necessary here.

And no need to call $ that much, a sole `this` is enough:

this.each(function(){
    $(this).oldCSSMethod(o.call(this));
})
: this.oldCSSMethod.apply(this, arguments);
]]>
By: Joe McCann https://j11y.io/snippets/passing-function-to-jquery-css-method/#comment-340 Tue, 30 Dec 2008 17:41:15 +0000 https://j11y.io/?p=305#comment-340 Wow, instantly added you to my Google Reader. Brilliant!

]]>