diff --git a/index.html b/index.html index 2e02862..0f725a3 100755 --- a/index.html +++ b/index.html @@ -42,7 +42,18 @@ $(document).ready(function(){ }) .bind('hashchange', function(e){ e.preventDefault() - setCurrentPage(loadURLState()) + var r = loadURLState() + // if we are dealing with history actions the browser will + // do the work for us... + if(r == 'back'){ + window.history.go(-2) + return + } else if(r == 'forward'){ + window.history.go(2) + return + } else { + setCurrentPage(r) + } }) $('.viewer') @@ -179,7 +190,7 @@ $(document).ready(function(){ Page #1
Named page

- Anchor on page #3
+ Anchor on page #3
currently navigation via existing anchors will break the layout, so use the name attribute on any other tags (see example). @@ -204,13 +215,17 @@ $(document).ready(function(){ Previous page
Next article
Previous article
+

History support

+ NOTE: this is still a bit flaky...
+ Go back
+ Go forward
- next page...
+ configuration demo next page...
-