alexander-ruehle / paper-collapse

Collapsible paper cards.
http://bbo-code.com/components/paper-collapse
163 stars 60 forks source link

expanded by default #7

Open jmls opened 9 years ago

jmls commented 9 years ago

is it possible to have a section expanded by default ?

awesome work, by the way.

alexander-ruehle commented 9 years ago

First of, thank you for your kind words.

Good idea, i will roll this out in the next version.

As a quick fix and workaround you can try to add the 'active' class to the collapse-card and add a style attribute to the collapse-card__body with display block. This would make on component expanded by default.

Example:

<div class="collapse-card active">
  <div class="collapse-card__heading">
    <div class="collapse-card__title">
      <i class="fa fa-question-circle fa-2x fa-fw"></i>
      title here
    </div>
  </div>
  <div class="collapse-card__body" style="display: block;">
    text here
  </div>
</div>
jmls commented 9 years ago

ohhh, close ;) thanks for the feedback - however there is a problem. When the form is first viewed, the card is indeed popped out - but with no content. click on the card to shrink, click again to expand, and it's all there. see below ;)

screenshot - 200315 - 08 47 20 screenshot - 200315 - 08 47 36

alexander-ruehle commented 9 years ago

Can you post your code here? I think you missed the style="display: block;" part on the .collapse-card__body

jmls commented 9 years ago

um, ah, well, cough

No, I didn't miss it out ... I had

<div class="collapse-card__body style="display: block;">

spot the deliberate mistake ;)

thanks again

alexander-ruehle commented 9 years ago

That explains a lot. ;) Glad i could help.