12fc696363567ee93bc474eb2f749f6fb58b14e3
[platform/framework/web/crosswalk.git] / src / content / test / data / overscroll_navigation.html
1 <html>
2 <title>Title: 0</title>
3 <style>
4
5 .large {
6   width: 300px;
7   height: 100px;
8   background-color: red;
9   margin: 300px;
10 }
11
12 ::-webkit-scrollbar {
13     display: none;
14 }
15
16 </style>
17
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>
28
29 <script>
30
31 function get_current() {
32   if (location.hash.length == 0)
33     return 0;
34   return parseInt(location.hash.substr(1));
35 }
36
37 function navigate_next() {
38   var current = get_current();
39   current = (current + 1) % 10;
40   location.hash = "#" + current;
41 }
42
43 function navigate_prev() {
44   var current = get_current();
45   current = (current + 9) % 10;
46   location.hash = "#" + current;
47 }
48
49 function touch_start_handler() {
50 }
51
52 function install_touch_handler() {
53   document.addEventListener('touchstart', touch_start_handler);
54 }
55
56 function uninstall_touch_handler() {
57   document.removeEventListener('touchstart', touch_start_handler);
58 }
59
60 function use_replace_state() {
61   window.history.replaceState({}, 'foo');
62 }
63
64 function use_push_state() {
65   window.history.pushState({}, 'foo2');
66 }
67
68 onload = function() {
69   window.onhashchange = function() {
70     document.title = "Title: " + location.hash;
71   }
72 }
73
74 </script>
75
76 </html>