Jump to content
Carlos Rocha

Animação jQuery

Recommended Posts

Carlos Rocha

Então, eu tenho uma ul

ul#menuTopo {

    display: none;

}

ul#menuTopo > li > a {

	display: block;
    width: 50px;

}
<button id="abrirMenu">Abrir menu</button>

<ul id="menuTopo">

       <li><a href="">Link 1</a>

       <li><a href="">Link 2</a>

       <li><a href="">Link 3</a>

       <li><a href="">Link 4</a>

       <li><a href="">Link 5</a>

</ul>
$("#abrirMenu").click ( function() {

        var status =  $("#menuTopo").css("display");

       if ( status == "none") {

                 $("#menuTopo").animate (

                         $( this ).show()

                 );

     } else {

                 $("#menuTopo").animate (

                         $( this ).hide()

                 );

    }

});

O objetivo é que, ao clicar em abrir menu, as lis, que contem os itens do menu, aparecem uma após a outra e decima para baixo.

Mas não estou conseguindo!

 

Edited by carcleo

Share this post


Link to post
Share on other sites
N3lson
$("#abrirMenu").click ( function() {

      $( "#menuTopo" ).animate({
      // o que queres fazer
      opacity: 0.25 //exemplo
      }, 5000, function() {
         $(this).slideToggle();
      });
    });
});

 


You can't do it, kid. But don't worry, my boy. You're not the only one. No one else can do it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.