indefero/www/media/idf/js/wiki-toc.js

12 lines
395 B
JavaScript
Raw Permalink Normal View History

2011-01-07 21:33:18 +00:00
$(document).ready(function() {
$(":header", "#wiki-content").map(function(index) {
2011-01-07 21:33:18 +00:00
this.id = "wikititle_" + index;
$("<a href='#" + this.id + "'>" + jQuery.fn.text([this]) + "</a>")
.addClass("wiki-" + this.tagName.toLowerCase())
.appendTo('#wiki-toc-content');
});
if ($('#wiki-toc-content *').size() < 2)
$('#wiki-toc').hide();
2011-01-07 21:33:18 +00:00
});