0

Simple question, really. I like, and want the look of collapsibles when they're in a collapsibleset (first two collapsibles in example below) when they're not in a collapsibleset (last two collapsibles). The reason I can't just use a collapsibleset is that I can't find any way to prevent the accordion feature of them (no idea why this isn't optional). It may be just a CSS styling thing, but I've also had no luck figuring out where to get rid of that gap at the top and bottom of the container, but keep the rounded corners.

This feels incredibly simple, but I've tried numerous approaches, but just can't find out how to do it.

http://jsfiddle.net/L14z0x12/3/

<div data-role="main" class="ui-content">
  <div class="ui-body ui-body-a ui-corner-all">
   <div data-role="collapsibleset">
    <div data-role="collapsible" data-collapsed="true">
     <h2>Collapsible in collapsibleset 1</h2>
     <p>Some Content</p>
    </div>
    <div data-role="collapsible" data-collapsed="true">
     <h2>Collapsible in collapsibleset 2</h2>
     <p>Some Content</p>
    </div>
   </div>
   <div class="ui-body ui-body-a ui-corner-all">
    <div data-role="collapsible" data-inset="false">
     <h2>Collapsible 1</h2>
     <p>Some Content</p>
    </div>
    <div data-role="collapsible" data-inset="false">
     <h2>Collapsible 2</h2>
     <p>Some Content</p>
    </div>
   </div>
 </div>
</div>
seaders
  • 3,878
  • 3
  • 40
  • 64

1 Answers1

1

Just add the class, ui-collapsible-set, to a containing div:

<div class="ui-collapsible-set">
    <div data-role="collapsible" data-inset="true" >
       <h2>Collapsible 1</h2>
       <p>Some Content</p>
    </div>
    <div data-role="collapsible" data-inset="true">
       <h2>Collapsible 2</h2>
       <p>Some Content</p>
    </div>
</div>

Then if you want the rounded corners on the first and last collapsibles, add these CSS rules:

.ui-collapsible-set .ui-collapsible:first-child {
    border-top-left-radius: 0.3125em !important;
    border-top-right-radius: 0.3125em !important;
}
.ui-collapsible-set .ui-collapsible:last-child {
    border-bottom-left-radius: 0.3125em !important;
    border-bottom-right-radius: 0.3125em !important;
}

Here is your updated FIDDLE

ezanker
  • 24,628
  • 1
  • 20
  • 35
  • Thanks so for much, this really was driving me crazy, now everything looks way nicer. I'm still not 100% on top of the CSS, but that snippet being that specifically focused to one thing definitely helps me start. – seaders Oct 20 '14 at 17:22