Merge pull request #77 from asolove/scroll-sidebar-to-active-section

On page load, scroll sidebar to active section. Resolves #21.
This commit is contained in:
Mathieu David 2015-12-27 10:50:04 +01:00
commit 50504282fb
1 changed files with 7 additions and 0 deletions

View File

@ -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
$("#print-button").click(function(){ $("#print-button").click(function(){
var printWindow = window.open("print.html"); var printWindow = window.open("print.html");