-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
back to top link #80
Comments
Would love a table of contents! |
Edit: I see that you can manually add a table of contents with the Also IMO it should created the ToC based on all headings tags not just h2 and h3. |
Hi, I have 2 ways to go to TOP
\> [Homepage](/biblio.code)
[Go UP](#homepage)
<a href="#" style="position: fixed;bottom: 15px;right: 30px;z-index: 99;font-size: 12px;border: none;outline: none;background-color: red;color: white;cursor: pointer;padding: 15px;border-radius: 4px;" target="_top">TOP</a> |
we can add a green (main color) button in the bottom of the page.. |
Due to my basic PHP knowledge, it is preferable to be "someone" with more knowledge to add the back to top link to the wikidocs code. Teste on wikidocs 1.0.37 and 1.0.42.
<script>
// Get the button Top
let mybutton = document.getElementById("myBtn");
// When the user scrolls down 30px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 40 || document.documentElement.scrollTop > 40) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script> |
About the TOC, not everyone like TOC on every doc. One example would be a short page doesn't need TOC... We want to follow standard wiki workflows. |
Hi @leomoon , I don't understand what you mean by TOC, but if you are referencing the text with dot point,
The code only add the lower right corner green top button Images is to show with-out and with top button!!! Code is based on: https://www.w3schools.com/howto/howto_js_scroll_to_top.asp |
TOC = table of contents. |
Please check if my location of UP button is good, otherwise send me better location to I try. |
Hi @ffiesta, open a pull request so we can test it together, if necessary we can make the changes directly there!
|
Add **Go to top** green button. Issue Zavy86#80
This is added thanks to @ffiesta in version 1.0.60 |
There are only 2 (fairly minor) features that I feel are missing:
Originally posted by @stormpaul in https://github.com/Zavy86/WikiDocs/issues/75#issuecomment-1864726381
The text was updated successfully, but these errors were encountered: