Add "Back to top"?
Opened this issue · 2 comments
chuyangliu commented
Boostrap official site has a "Back to top" at the end of the TOC. Could bootstrap-toc add the same feature?
afeld commented
Pull request welcome! Would want to make it optional.
DarkNami commented
Simple way without PR:
$(function() {
var navSelector = "#toc";
var $myNav = $(navSelector);
Toc.init($myNav);
$myNav.append('<a class="back-to-top" href="">Back to top</a>');
$("body").scrollspy({
target: navSelector
});
});