use variable in . eq

Asked

Viewed 9 times

1

I need to put the value of a variable in the method . eq, this variable takes an integer value. But it doesn’t work. I’ve tried several ways and nothing.

$(document).ready(function(){
    i = 0;
    for(i = 0; i <= 30; i++)
    {
        $(".textoAberto").hide();
        $(".titlePrincipal").eq(i).click(function(){
            $(".textoAberto").eq(i).show();
        });
    };
    });
  • I think this answer may also be useful: http://answall.com/a/128813/129

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.