summaryrefslogtreecommitdiffstats
path: root/content/test/data/overscroll_navigation.html
blob: 7ea687bc608e1bf1f6ad4a61196324a9ce5226ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html>
<title>Title: 0</title>
<style>

.large {
  width: 300px;
  height: 100px;
  background-color: red;
  margin: 300px;
}

</style>

<div name='0' class='large'></div>
<div name='1' class='large'></div>
<div name='2' class='large'></div>
<div name='3' class='large'></div>
<div name='4' class='large'></div>
<div name='5' class='large'></div>
<div name='6' class='large'></div>
<div name='7' class='large'></div>
<div name='8' class='large'></div>
<div name='9' class='large'></div>

<script>

function get_current() {
  if (location.hash.length == 0)
    return 0;
  return parseInt(location.hash.substr(1));
}

function navigate_next() {
  var current = get_current();
  current = (current + 1) % 10;
  location.hash = "#" + current;
}

function navigate_prev() {
  var current = get_current();
  current = (current + 9) % 10;
  location.hash = "#" + current;
}

function touch_start_handler() {
}

function install_touch_handler() {
  document.addEventListener('touchstart', touch_start_handler);
}

function uninstall_touch_handler() {
  document.removeEventListener('touchstart', touch_start_handler);
}

onload = function() {
  window.onhashchange = function() {
    document.title = "Title: " + location.hash;
  }
}

</script>

</html>