$(document).ready(function(){ $(".toggle_faq").hide(); $("h3.switch").click(function(){ $(this).toggleClass("active").next().slideToggle("normal"); return false; }); });
<h3 class="switch faq_head">なんで生きてるの?</h3><div class="toggle_faq faq">別にいいですやん</div><br /> <h3 class="switch faq_head">なぜ地球は丸いの?</h3><div class="toggle_faq faq">丸いからです</div><br /> <h3 class="switch faq_head">今まで何匹のワンコをもふもふしてきたの?</h3><div class="toggle_faq faq">50匹かな</div><br /> <h3 class="switch faq_head">なんで貧乏なの?</h3><div class="toggle_faq faq">しらんがな</div><br />
*{font-family: "メイリオ", "Meiryo", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "MS ゴシック", "Osaka", sans-serif ;} h3.switch { font-size: 22px ; padding:7px 0 7px 22px ; border-left: 3px solid #e91b1b; margin: 10px 0; color: #282828 ; cursor:pointer; } h3.active { color: red; } .toggle_faq { overflow: hidden; padding: 20px 10px; }