OLD | NEW |
1 <!-- | 1 <!-- |
2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 --> | 5 --> |
6 <!DOCTYPE html> | 6 <!DOCTYPE html> |
7 <html> | 7 <html> |
8 <head> | 8 <head> |
9 <meta charset="utf-8"> | 9 <meta charset="utf-8"> |
10 <meta name="viewport" | 10 <meta name="viewport" |
(...skipping 11 matching lines...) Expand all Loading... |
22 height: 100%; | 22 height: 100%; |
23 -webkit-user-select: none; | 23 -webkit-user-select: none; |
24 } | 24 } |
25 </style> | 25 </style> |
26 </head> | 26 </head> |
27 <script> | 27 <script> |
28 window.startLoad = new Date().getTime(); | 28 window.startLoad = new Date().getTime(); |
29 </script> | 29 </script> |
30 <body> | 30 <body> |
31 <city-list></city-list> | 31 <city-list></city-list> |
| 32 <script> |
| 33 var cityList = document.querySelector('city-list'); |
| 34 var scrollBy = location.search.match(/auto=([0-9]+)/)[1]; |
| 35 |
| 36 function autoScroll() { |
| 37 cityList.scrollBy(scrollBy); |
| 38 requestAnimationFrame(autoScroll); |
| 39 } |
| 40 |
| 41 if (scrollBy) { |
| 42 console.log('Autoscroll by ' + scrollBy); |
| 43 setTimeout(function() { |
| 44 requestAnimationFrame(autoScroll); |
| 45 }, 200) |
| 46 } |
| 47 </script> |
32 </body> | 48 </body> |
33 </html> | 49 </html> |
OLD | NEW |