Difference between revisions of "User:Knightmare/common.js"

From ARMCO
Jump to navigation Jump to search
(Created page with "$(document).ready(function() { // Check if the TOC exists var toc = $('#toc'); if (toc.length) { toc.find('ul').hide(); // Hide the nested TOC levels...")
 
(Blanked the page)
Tag: Blanking
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
$(document).ready(function() {
// Check if the TOC exists
var toc = $('#toc');
if (toc.length) {
toc.find('ul').hide(); // Hide the nested TOC levels

toc.find('li').each(function() {
var $li = $(this);
var $link = $li.find('a').first();
if ($link.length) {
// Add a click handler to toggle the nested TOC
$link.click(function() {
$li.children('ul').toggle();
});
}
});
}
});

Latest revision as of 16:28, 18 November 2024