-
-
Save daimac178/02689f46436eb79d99af670154b1641a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************ | |
** TOC開くと閉じるを表示するJavascript | |
************************************/ | |
jQuery(function($){ | |
var flg = "opened"; | |
$(".toc-title").append('<span class="toc-toggle-label">[<a class="toc-toggle-link">表示</a>]</span>'); //切り替えボタンの設置 | |
$('.toc-toggle-link').on('click', function() { | |
$('.toc-list').slideToggle('fast'); //.toc-listの表示・非表示の切り替え | |
if(flg == 'closed'){ | |
$(this).text('表示'); //非表示時の切り替えボタンテキスト | |
flg = 'opened'; | |
}else{ | |
$(this).text('非表示'); //表示時の切り替えボタンテキスト | |
flg = 'closed'; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment