1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

edit content h1 title

This commit is contained in:
ruanyf 2014-04-22 08:22:28 +08:00
parent 570fa0e223
commit 0d052ac49e

View File

@ -108,13 +108,14 @@ function create_page_anchors() {
// if there is a match, create click listeners
// and scroll to relevant sections
// go through header level 2 and 3
for (var i = 2; i <= 4; i++) {
// go through header level 1 to 3
for (var i = 1; i <= 4; i++) {
// parse all headers
var headers = [];
$('#content h' + i).map(function() {
headers.push($(this).text());
$(this).addClass(replace_symbols($(this).text()));
this.id = 'h'+1+'-'+replace_symbols($(this).text();
});
// parse and set links between li and h2