Difference between revisions of "User:Knightmare/common.js"
Jump to navigation
Jump to search
Knightmare (talk | contribs) (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...") |
Knightmare (talk | contribs) (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(); |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
}); |