mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-14 06:42:35 +00:00
On page load, scroll sidebar to active section.
This commit is contained in:
parent
a2b25232d3
commit
1de00f9cd7
1 changed files with 7 additions and 0 deletions
|
@ -50,6 +50,13 @@ $( document ).ready(function() {
|
|||
});
|
||||
|
||||
|
||||
// Scroll sidebar to current active section
|
||||
var activeSection = sidebar.find(".active");
|
||||
if(activeSection.length) {
|
||||
sidebar.scrollTop(activeSection.offset().top);
|
||||
}
|
||||
|
||||
|
||||
// Print button
|
||||
$("#print-button").click(function(){
|
||||
var printWindow = window.open("print.html");
|
||||
|
|
Loading…
Reference in a new issue