diff options
author | amzrk2 | 2020-04-24 14:32:27 +0800 |
---|---|---|
committer | amzrk2 | 2020-04-24 14:32:27 +0800 |
commit | 545b156568672aa6b28713ca4ee6d153ade2281a (patch) | |
tree | 0b5d4878444e7633cd0b4af893d7fe69538e0fbd | |
parent | 50900be20164758f1ae3ef1fb18d65424bc98743 (diff) | |
download | hugo-theme-fuji-545b156568672aa6b28713ca4ee6d153ade2281a.tar.gz hugo-theme-fuji-545b156568672aa6b28713ca4ee6d153ade2281a.tar.bz2 hugo-theme-fuji-545b156568672aa6b28713ca4ee6d153ade2281a.zip |
Smooth toc html anchor
-rw-r--r-- | layouts/partials/scripts.html | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 2f83c91..fd5aa3b 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -60,6 +60,17 @@ }); </script> {{ end }} +{{ if in .Site.Params.mainSections .Type }} +<!-- toc smooth scroll & aplayer cjk html anchor fix --> +<script> + $("#widget-toc a").click(function () { + $("html, body").animate({ + scrollTop: $($(this).attr("href")).offset().top + }); + return false; + }); +</script> +{{ end }} {{ if .Site.Params.scrollTop }} <!-- scroll to top button --> <script> |