Your code snippet is the best approach.
Mootools is fast at retrieving elements that have already been 'touched'.
The biggest culprit in performance is the DOM traversal.
On Tue, Oct 7, 2008 at 5:06 PM, Michael Duff <[EMAIL PROTECTED]> wrote:
>
> Hey Everyone,
>
> I have a question about coding style, I will be using the same "items"
> over and over throughout a class I am writing, so would it be better
> to place these items in an array for later use?
>
>
> $$('.someclass').each(function(item, index) {
> this.items[] = item;
> });
>
>
> then anytime I need to loop through them I can just use this.items
> instead of $$, does anyone know if its more expensive to store
> references to those items or for mootools to go find them each time?
>
> Mike
>
>