(function ($) { $("#test").hide(); // CSSではなく、ここで非表示にする。 $("#btn-01").on("click", function () { $("#test").slideToggle(); }); }(jQuery));
<div id="test"> <p>テストです。</p> </div><!-- /#test --> <div> <button id="btn-01">SlideDown / SlideUp</button> </div>
p{ margin: 0; } #test{ margin-bottom: 20px; width: 200px; height: 150px; background-color: #efefef; }