> If you have a jquery array of elements and need to call the show("slow")
> method on each one in turn, how should you do it?
> 
> For instance how might would you reveal each LI element in a list one
> after
> the other?
> Just applying the show() method reveals them all at once eg: $("#myList
> LI").show("slow") so that's not what I need.
> 
> Using callbacks works for one or two items but does not adapt easily to
> many
> items. I saw a technique somewhere that used arguments.callee, can anyone
> suggest how that might be used?

My untested stab, with a callback:

var jquery = $(/*select stuff*/),
    position = 0;
var handler = function() {
    if(position < jquey.length)
        $(jquery[position++]).show("slow", handler);
};
handler();

This doesn't look too bad, does it? I hope it helps.

Not that I select the current DOM element via jquery[index] and wrap that into 
a jQuery again. Using eq(index) would be more elegant, but kills my original 
object, forcing me to use end().

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to