Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Does something like this work?</p> <ul> <li><a href="http://jsfiddle.net/UUhMa/" rel="noreferrer">http://jsfiddle.net/UUhMa/</a></li> <li><a href="http://jsfiddle.net/UUhMa/3/" rel="noreferrer">http://jsfiddle.net/UUhMa/3/</a> ( without the foreach )</li> </ul> <p>JS</p> <pre><code>$('#openAll').on('click', function() { $('.openMe').each(function() { var coll = $(this); coll.trigger('expand'); }); }); $('#closeAll').on('click', function() { $('.openMe').each(function() { var coll = $(this); coll.trigger('collapse'); }); }); </code></pre> <p>Alternate JS ( without the foreach ):</p> <pre><code>$('#openAll').on('click', function() { $('.openMe').trigger('expand'); }); $('#closeAll').on('click', function() { $('.openMe').trigger('collapse'); }); </code></pre> <p>HTML</p> <pre><code>&lt;div data-role="collapsible" class="openMe"&gt; &lt;h3&gt;Hello 1&lt;/h3&gt; &lt;p&gt;I'm the collapsible content. By default I'm closed, but you can click the header to open me.&lt;/p&gt; &lt;/div&gt; &lt;div data-role="collapsible" class="openMe"&gt; &lt;h3&gt;Hello 2&lt;/h3&gt; &lt;p&gt;I'm the collapsible content. By default I'm closed, but you can click the header to open me.&lt;/p&gt; &lt;/div&gt; &lt;div data-role="collapsible" class="openMe"&gt; &lt;h3&gt;Hello 3&lt;/h3&gt; &lt;p&gt;I'm the collapsible content. By default I'm closed, but you can click the header to open me.&lt;/p&gt; &lt;/div&gt; &lt;br /&gt; &lt;a href="#" data-role="button" id="openAll"&gt;Open All Collapsible&lt;/a&gt; &lt;a href="#" data-role="button" id="closeAll"&gt;Close All Collapsible&lt;/a&gt; ​ </code></pre> <p>Docs:</p> <ul> <li><a href="http://jquerymobile.com/demos/1.1.0/docs/content/content-collapsible.html" rel="noreferrer">http://jquerymobile.com/demos/1.1.0/docs/content/content-collapsible.html</a></li> </ul> <p>Looks like this wont work on a set as only one can be open at a time:</p> <ul> <li><a href="http://jsfiddle.net/UUhMa/1/" rel="noreferrer">http://jsfiddle.net/UUhMa/1/</a></li> </ul> <p>Set Docs:</p> <ul> <li><a href="http://jquerymobile.com/demos/1.1.0/docs/content/content-collapsible-set.html" rel="noreferrer">http://jquerymobile.com/demos/1.1.0/docs/content/content-collapsible-set.html</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload