Use of Toggle() Jquery

Asked

Viewed 92 times

0

I am a beginner programmer, and I am trying to use an animation with toggle(), however this one is working, displaying and hiding a specific div, but there is no toggle animation, I would like you to check if the syntax is correct.

function toggle(idCliente){
    $("tr[id^='mostraDiv']").stop(false, true).slideUp("slow");
    $("#mostraDiv"+idCliente).stop(false, true).slideToggle("slow");
}
  • 1

    This stop(false, true) action is the one that takes the decitions of the start or end of the stop actions. The method name is also wrong, because toggle is a reserved name for jquery methods. If you want to make only one toggle, you can choose the $('...'). toggle() method of jquery.

  • http://api.jquery.com/toggle/

  • http://jsfiddle.net/b24wx00d/ example tlz help.

  • http://www.linhadecodigo.com.br/artigo/3481/criando-efeitos-de-fade-e-slide-com-jquery.aspx plus one more example, for development

No answers

Browser other questions tagged

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