whenever manageNextPrev() is called, the page should scroll to top

this should also happen in hashchange() so that clicking on the links in the left navigation panel will bring the page to top
This commit is contained in:
Yihui Xie
2013-09-09 13:54:44 -05:00
parent 4e9474f982
commit d3952b60af

View File

@@ -451,6 +451,7 @@ hljs.initHighlightingOnLoad();
function manageNextPrev() {
$('a#next').parent().toggleClass('disabled', $('.nav li.active').nextAll('li:not(.nav-header)').size() == 0);
$('a#previous').parent().toggleClass('disabled', $('.nav li.active').prevAll('li:not(.nav-header)').size() == 0);
$('html,body').scrollTop(0);
}
manageNextPrev();