mirror of
https://github.com/mashirozx/sakura.git
synced 2024-11-22 14:58:14 +08:00
fix #79
This commit is contained in:
parent
6e1fece53a
commit
82ce5b80d6
@ -546,20 +546,10 @@ function tableOfContentScroll(flag) {
|
|||||||
} else if ($("div").hasClass("have-toc") == false && $("div").hasClass("has-toc") == false) {
|
} else if ($("div").hasClass("have-toc") == false && $("div").hasClass("has-toc") == false) {
|
||||||
$(".toc-container").remove();
|
$(".toc-container").remove();
|
||||||
} else {
|
} else {
|
||||||
$(document).ready(function () {
|
|
||||||
if ($("div").hasClass("toc")) {
|
|
||||||
$(".toc-container").css("height", $(".site-content").outerHeight());
|
|
||||||
setTimeout(function () {
|
|
||||||
$(".toc-container").css("height", $(".site-content").outerHeight());
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(function () {
|
|
||||||
$(".toc-container").css("height", $(".site-content").outerHeight());
|
|
||||||
}, 6000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
var id = 1;
|
var id = 1,
|
||||||
$(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function () {
|
heading_fix=$("div").hasClass("pattern-attachment-img") ? -75 : 200;
|
||||||
|
$(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function() {
|
||||||
var hyphenated = "toc-head-" + id;
|
var hyphenated = "toc-head-" + id;
|
||||||
this.id = hyphenated;
|
this.id = hyphenated;
|
||||||
id++;
|
id++;
|
||||||
@ -568,6 +558,7 @@ function tableOfContentScroll(flag) {
|
|||||||
tocSelector: '.toc',
|
tocSelector: '.toc',
|
||||||
contentSelector: ['.entry-content', '.links'],
|
contentSelector: ['.entry-content', '.links'],
|
||||||
headingSelector: 'h1, h2, h3, h4, h5',
|
headingSelector: 'h1, h2, h3, h4, h5',
|
||||||
|
headingsOffset: heading_fix-window.innerHeight/2,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8480,4 +8480,11 @@ td.hljs-ln-numbers {
|
|||||||
background: #ddd;
|
background: #ddd;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
h1[id*=toc-head]::before,h2[id*=toc-head]::before,h3[id*=toc-head]::before,h4[id*=toc-head]::before,h5[id*=toc-head]::before,h6[id*=toc-head]::before {
|
||||||
|
display:block;
|
||||||
|
content:" ";
|
||||||
|
height:80px;
|
||||||
|
margin-top:-80px;
|
||||||
|
visibility:hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user