I keep running up against this issue, which reflects my basic lack of understanding.
I want to collect all instances of a class, then be able to have a function which understands which element instance called it.
I created a Fiddle, http://jsfiddle.net/AKa4s/, which doesn't work, just to try to explain my question.
It's like this, I collect all the div elements & assign a function to it: $(".square").each(writeColorpanel);
Then in that function I need to call another function. The next function seems to have absolutely no idea who called. I need caller ID (joke).
The problem is that I end up running the same calculations for different divs, and repeating the function so that I can apply css to each of the divs based on the results.