hide div when page load

前端 未结 3 908
情深已故
情深已故 2021-01-18 05:28

I have jquery issue, Kindly see my jquery code:

$(document).ready(function(){

    $(\".toggle_container\").show();

    $(\"h2.trigger\").toggle(function(){         


        
3条回答
  •  孤独总比滥情好
    2021-01-18 05:46

    You can just add attribute

    style="display:none"
    

    to your element .toggle_container.

    Then on first call of $(document).ready it will be shown.

    The full test example:

    
    
      
      
    
    
      

    Toggle

    Note: there`s no $(".toggle_container").show(); on $(document).ready

提交回复
热议问题