[jQuery] Re: loop through div

2009-03-17 Thread ricardobeat
Oops. Didn't run the code long enough to see that, my mistake. When this[i] is undefined the jQ object returns with document. Using eq() instead can fix it. jQuery.fn.showLoop = function(){ var i = i || 0, self = this; this.eq(i).show(600, function(){ self.showLoop(++i); }); }; bu

[jQuery] Re: loop through div

2009-03-16 Thread Tom Shafer
doesnt seem to work get a recursion error thanks! On Mar 16, 7:26 pm, ricardobeat wrote: > jQuery.fn.showLoop = function(i){ >   var i = i || 0, >     self = this; >   $( this[i] ).show(600, function(){ >        self.showLoop(++i); >   }); > > }; > > $('.type').showLoop(); > > On Mar 16, 7:27 pm

[jQuery] Re: loop through div

2009-03-16 Thread Karl Swedberg
Dave Methvin showed someone else another way to do this back in December. Here is a slightly modified version of his approach: $(document).ready(function() { var $divs = $('div').hide(), div = 0; (function(){ $divs.eq(div++).show('slow', arguments.callee); })(); }); --Karl

[jQuery] Re: loop through div

2009-03-16 Thread Tom Shafer
im getting too much recursion in firebug, any thought? On Mar 16, 7:26 pm, ricardobeat wrote: > jQuery.fn.showLoop = function(i){ >   var i = i || 0, >     self = this; >   $( this[i] ).show(600, function(){ >        self.showLoop(++i); >   }); > > }; > > $('.type').showLoop(); > > On Mar 16, 7:

[jQuery] Re: loop through div

2009-03-16 Thread Tom Shafer
thanks guys! On Mar 16, 7:26 pm, ricardobeat wrote: > jQuery.fn.showLoop = function(i){ >   var i = i || 0, >     self = this; >   $( this[i] ).show(600, function(){ >        self.showLoop(++i); >   }); > > }; > > $('.type').showLoop(); > > On Mar 16, 7:27 pm, Tom  Shafer wrote: > > > how can i

[jQuery] Re: loop through div

2009-03-16 Thread ricardobeat
jQuery.fn.showLoop = function(i){ var i = i || 0, self = this; $( this[i] ).show(600, function(){ self.showLoop(++i); }); }; $('.type').showLoop(); On Mar 16, 7:27 pm, Tom Shafer wrote: > how can i loop through each div on a page and have them appear one by > one > i am tryin

[jQuery] Re: loop through div

2009-03-16 Thread James
var arrayList2 = $(".list"); // set of elements with class 'list' $.each(arrayList2, function() { $(this).show(); }); Note that this will have all the elements display at once (technically). If you want it so that one appears, then another one appears maybe a second later, then another appe