OLD | NEW |
(Empty) | |
| 1 |
| 2 <!--- |
| 3 |
| 4 This README is automatically generated from the comments in these files: |
| 5 iron-collapse.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 [![Build Status](https://travis-ci.org/PolymerElements/iron-collapse.svg?branch=
master)](https://travis-ci.org/PolymerElements/iron-collapse) |
| 13 |
| 14 _[Demo and API Docs](https://elements.polymer-project.org/elements/iron-collapse
)_ |
| 15 |
| 16 |
| 17 ##<iron-collapse> |
| 18 |
| 19 |
| 20 `iron-collapse` creates a collapsible block of content. By default, the content |
| 21 will be collapsed. Use `opened` or `toggle()` to show/hide the content. |
| 22 |
| 23 <button on-click="toggle">toggle collapse</button> |
| 24 |
| 25 <iron-collapse id="collapse"> |
| 26 <div>Content goes here...</div> |
| 27 </iron-collapse> |
| 28 |
| 29 ... |
| 30 |
| 31 toggle: function() { |
| 32 this.$.collapse.toggle(); |
| 33 } |
| 34 |
| 35 `iron-collapse` adjusts the height/width of the collapsible element to show/hide |
| 36 the content. So avoid putting padding/margin/border on the collapsible directly
, |
| 37 and instead put a div inside and style that. |
| 38 |
| 39 <style> |
| 40 .collapse-content { |
| 41 padding: 15px; |
| 42 border: 1px solid #dedede; |
| 43 } |
| 44 </style> |
| 45 |
| 46 <iron-collapse> |
| 47 <div class="collapse-content"> |
| 48 <div>Content goes here...</div> |
| 49 </div> |
| 50 </iron-collapse> |
| 51 |
| 52 |
OLD | NEW |