>     var arrElementos = $("p").get();
>     var tempo = 1000;
>     for(var i in arrElementos) {
>         if (i == 0) {
>
> setTimeout($(arrElementos[i]).DropInRight(1000), tempo);
>         }
>         else {
>             setTimeout($(arrElementos[i]).DropInLeft(1000),
> tempo);
>         }
>     }


This statement:

   $("p").get();

returns an Array, not an Object.  Iterate an Array with a normal for
loop instead of a for-in loop.

setTimeout takes a string or a function reference.  You're executing:

    $(arrElementos[i]).DropInLeft(1000)

and passing the result to setTimeout.


You could probably rewrite what you have like this:

$(function() {
    setTimeout(dropIn, 1000);
});

function dropIn() {
    $("p").each(function(i) {
        i==0 ? $(this).DropInRight(1000) : $(this).DropInLeft(1000);
    });
}

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

Reply via email to