So I have a function that is recursive for inverting colors. Here is the code:
function invert(id,what){ var color = $(id).css(what); var matchColors
I am not sure what your exact scenario is, but maybe you could override the function with a wrapper:
var invertOriginal = invert; var counter = 0; var invert = function(id, what, max) { invertOriginal(id, what, max); // do counter stuff here, e.g. counter++; };