[jQuery] Re: Returning a new collection from a method

2007-12-13 Thread Wizzud
pushStack() should return its argument as a jQuery object. So if you give it an array of elements it should come back as a jQuery 'collection' of those elements. $([]) gives an empty jQuery object. On Dec 12, 7:49 pm, McLars <[EMAIL PROTECTED]> wrote: > I could not get the first example to work.

[jQuery] Re: Returning a new collection from a method

2007-12-12 Thread McLars
I could not get the first example to work. Again, I just can't seem to grasp what map does or how to make it work. The second example is very close to working, except that it returns an array, not a jQuery collection. So, let me try rephasing my question. How do I create an empty jQuery collectio

[jQuery] Re: Returning a new collection from a method

2007-12-12 Thread Wizzud
Simply return your new collection. How you get your new collection from the current object may well involve map(), but however you do it, all you need to do is return whatever collection you want to continue the chain with. It is probably advisable to use pushStack(), so that your original collect