Making slideToggle() elements collapsed by default in jQuery

后端 未结 4 1568
遇见更好的自我
遇见更好的自我 2020-12-29 03:29

I have a set of divs that I want to make collapsible/expandable using jQuery\'s slideToggle() method. How do I make all of these divs collapsed by

4条回答
  •  情话喂你
    2020-12-29 03:38

    You will have to assign a style: display:none to these layers, so that they are not displayed before javascript rendering. Then you can call slideToggle() without problems. Example:

    
    
    
    
                  
          

    I am using jquery
    I am using jquery
    I am using jquery
    I am using jquery
    I am using jquery
    I am using jquery

    show

提交回复
热议问题