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
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
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
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:
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.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
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
7 matches
Mail list logo