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:
parent
570fa0e223
commit
0d052ac49e
@ -108,13 +108,14 @@ function create_page_anchors() {
|
|||||||
// if there is a match, create click listeners
|
// if there is a match, create click listeners
|
||||||
// and scroll to relevant sections
|
// and scroll to relevant sections
|
||||||
|
|
||||||
// go through header level 2 and 3
|
// go through header level 1 to 3
|
||||||
for (var i = 2; i <= 4; i++) {
|
for (var i = 1; i <= 4; i++) {
|
||||||
// parse all headers
|
// parse all headers
|
||||||
var headers = [];
|
var headers = [];
|
||||||
$('#content h' + i).map(function() {
|
$('#content h' + i).map(function() {
|
||||||
headers.push($(this).text());
|
headers.push($(this).text());
|
||||||
$(this).addClass(replace_symbols($(this).text()));
|
$(this).addClass(replace_symbols($(this).text()));
|
||||||
|
this.id = 'h'+1+'-'+replace_symbols($(this).text();
|
||||||
});
|
});
|
||||||
|
|
||||||
// parse and set links between li and h2
|
// parse and set links between li and h2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user