にょるんにょるん。
<div id="whatsnew"> <h2>更新履歴</h2> <a href="#" id="viewAll">全て見る</a> <dl> <dt> 2013.08.13 </dt> <dd> 更新内容更新内容</dd> </dl> <div id="whatsnewAll"> <dl> <dt> 2013.08.12 </dt> <dd> 更新内容更新内容</dd> </dl> </div> </div>
$(function($){ $("#whatsnewAll").hide(); $("#viewAll").click(function () { $(this).toggleClass('selected') $("#whatsnewAll").slideToggle("slow"); if($(this).hasClass('selected')){ $(this).text('閉じる'); return false }else{ $(this).text('全て見る'); return false } }); });