Merge pull request #10 from Junyi-99/fix-ToC-cannot-click
Fix to c cannot click
This commit is contained in:
commit
ada44ff67d
@ -37,6 +37,7 @@ html {
|
|||||||
/* 2 */
|
/* 2 */
|
||||||
-webkit-text-size-adjust: 100%;
|
-webkit-text-size-adjust: 100%;
|
||||||
/* 2 */
|
/* 2 */
|
||||||
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
@ -7,13 +7,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.querySelector(".toc").addEventListener("click", function () {
|
document.querySelector(".toc").addEventListener("click", function () {
|
||||||
event.preventDefault();
|
if (event.target.tagName !== "A") {
|
||||||
if (this.open) {
|
event.preventDefault();
|
||||||
this.open = false;
|
if (this.open) {
|
||||||
this.classList.remove("expanded");
|
this.open = false;
|
||||||
} else {
|
this.classList.remove("expanded");
|
||||||
this.open = true;
|
} else {
|
||||||
this.classList.add("expanded");
|
this.open = true;
|
||||||
|
this.classList.add("expanded");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user