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 window
.touchmoveCount
= 0;
33 function get_current() {
34 if (location
.hash
.length
== 0)
36 return parseInt(location
.hash
.substr(1));
39 function navigate_next() {
40 var current
= get_current();
41 current
= (current
+ 1) % 10;
42 location
.hash
= "#" + current
;
45 function navigate_prev() {
46 var current
= get_current();
47 current
= (current
+ 9) % 10;
48 location
.hash
= "#" + current
;
51 function touch_start_handler() {
54 function touch_move_handler() {
55 window
.touchmoveCount
++;
58 function install_touch_handler() {
59 document
.addEventListener('touchstart', touch_start_handler
);
62 function install_touchmove_handler() {
63 document
.addEventListener('touchmove', touch_move_handler
);
66 function reset_touchmove_count() {
67 window
.touchmoveCount
= 0;
70 function uninstall_touch_handler() {
71 document
.removeEventListener('touchstart', touch_start_handler
);
74 function use_replace_state() {
75 window
.history
.replaceState({}, 'foo');
78 function use_push_state() {
79 window
.history
.pushState({}, 'foo2', 'newpath');
83 window
.onhashchange = function() {
84 document
.title
= "Title: " + location
.hash
;