OLD | NEW |
1 iron-pages | 1 |
2 ========== | 2 <!--- |
3 | 3 |
| 4 This README is automatically generated from the comments in these files: |
| 5 iron-pages.html |
| 6 |
| 7 Edit those files, and our readme bot will duplicate them over here! |
| 8 Edit this file, and the bot will squash your changes :) |
| 9 |
| 10 --> |
| 11 |
| 12 [](https://travis-ci.org/PolymerElements/iron-pages) |
| 13 |
| 14 _[Demo and API Docs](https://elements.polymer-project.org/elements/iron-pages)_ |
| 15 |
| 16 |
| 17 ##<iron-pages> |
| 18 |
| 19 |
4 `iron-pages` is used to select one of its children to show. One use is to cycle
through a list of | 20 `iron-pages` is used to select one of its children to show. One use is to cycle
through a list of |
5 children "pages". | 21 children "pages". |
6 | 22 |
7 Example: | 23 Example: |
8 | 24 |
9 ```html | 25 <iron-pages selected="0"> |
10 <iron-pages selected="0"> | 26 <div>One</div> |
11 <div>One</div> | 27 <div>Two</div> |
12 <div>Two</div> | 28 <div>Three</div> |
13 <div>Three</div> | 29 </iron-pages> |
14 </iron-pages> | |
15 | 30 |
16 <script> | 31 <script> |
17 document.addEventListener('click', function(e) { | 32 document.addEventListener('click', function(e) { |
18 var pages = document.querySelector('iron-pages'); | 33 var pages = document.querySelector('iron-pages'); |
19 pages.selectNext(); | 34 pages.selectNext(); |
20 }); | 35 }); |
21 </script> | 36 </script> |
22 ``` | 37 |
| 38 |
OLD | NEW |