[EMAIL PROTECTED] writes:

> FrozenDice <[EMAIL PROTECTED]> writes:
>
>> I've had a few projects where there are a huge number of elements
>> which all need the same property applied to them but I have always
>> done it by hand.
>> eg.
>>               $this->Panel_0_bevel->left = 288;
>>                $this->Panel_0_bevel->top = 48;
>>                $this->Panel_1_bevel->left = 288;
>>                $this->Panel_1_bevel->top = 48;
>>                $this->Panel_2_bevel->left = 288;
>>                $this->Panel_2_bevel->top = 48;
>>                $this->Panel_3_bevel->left = 288;
>>                $this->Panel_3_bevel->top = 48;
>>                ...
>>                ...
>>
>> I know there MUST be a way to do this with a loop in javascript, but I
>> just don't know how.  It's probably something easy, but it would
>> really help me.
>
> Here's one alternative:
>
> for (i = 0; i < n; i++)
> {
>   eval("$this->Panel_" + i + "_bevel->left = 288;" +
>        "$this->Panel_" + i + "_bevel->top = 48;");
> }

Oops, I have a vague recollection that you may need parenthesis around
the expression to be evaluated, so it may be something like this:

for (i = 0; i < n; i++)
{
  eval("($this->Panel_" + i + "_bevel->left = 288;" +
       " $this->Panel_" + i + "_bevel->top = 48;)");
}

Derrell

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to