2 <title>Title: 0</title>
18 <div name='0' class='large'></div>
19 <div name='1' class='large'></div>
20 <div name='2' class='large'></div>
21 <div name='3' class='large'></div>
22 <div name='4' class='large'></div>
23 <div name='5' class='large'></div>
24 <div name='6' class='large'></div>
25 <div name='7' class='large'></div>
26 <div name='8' class='large'></div>
27 <div name='9' class='large'></div>
31 function get_current() {
32 if (location.hash.length == 0)
34 return parseInt(location.hash.substr(1));
37 function navigate_next() {
38 var current = get_current();
39 current = (current + 1) % 10;
40 location.hash = "#" + current;
43 function navigate_prev() {
44 var current = get_current();
45 current = (current + 9) % 10;
46 location.hash = "#" + current;
49 function touch_start_handler() {
52 function install_touch_handler() {
53 document.addEventListener('touchstart', touch_start_handler);
56 function uninstall_touch_handler() {
57 document.removeEventListener('touchstart', touch_start_handler);
60 function use_replace_state() {
61 window.history.replaceState({}, 'foo');
64 function use_push_state() {
65 window.history.pushState({}, 'foo2');
69 window.onhashchange = function() {
70 document.title = "Title: " + location.hash;