| <html> |
| <title>Title: 0</title> |
| <style> |
| |
| .large { |
| width: 300px; |
| height: 100px; |
| background-color: red; |
| margin: 300px; |
| } |
| |
| ::-webkit-scrollbar { |
| display: none; |
| } |
| |
| </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); |
| } |
| |
| function use_replace_state() { |
| window.history.replaceState({}, 'foo'); |
| } |
| |
| function use_push_state() { |
| window.history.pushState({}, 'foo2'); |
| } |
| |
| onload = function() { |
| window.onhashchange = function() { |
| document.title = "Title: " + location.hash; |
| } |
| } |
| |
| </script> |
| |
| </html> |