From d3952b60af0908d5e5ee010d1e936549536ea106 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 9 Sep 2013 13:54:44 -0500 Subject: [PATCH] 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 --- tutorial/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/tutorial/index.html b/tutorial/index.html index 7e262cfff..7c68c7352 100644 --- a/tutorial/index.html +++ b/tutorial/index.html @@ -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();