Как получить доступ к внешнему this из функций jQuery?

из любопытства, есть ли способ получить доступ к this.color из paint функция?

function Foo(color)
{
    this.color = color;
    this.paint = function paint()
    {
       $("select").each(function(idx, el)
        {
            $(el).css("background", color); // OK
            // $(el).css("background", this.color); // this.color is undefined
        })
    }
}

new Foo("red").paint();

Спасибо

9
задан Paolo 11 April 2011 в 01:05
поделиться