Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can change the colors of your collapsed / expanded headers manually in <code>collapse</code> and <code>expand</code> events:</p> <pre><code>$("#mycollapsible").bind('expand', function() { // Change color here }).bind('collapse', function() { // Change color here }); </code></pre> <p>where <code>#mycollapsible</code> is the ID of your collapsible set.</p> <hr> <p><strong>Full working example:</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.8.2.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt; &lt;script&gt; function toggle_color() { $("#mycollapsible .ui-icon-arrow-r").parent().find(".ui-btn-text").css('color', "red"); $("#mycollapsible .ui-icon-arrow-l").parent().find(".ui-btn-text").css('color', "blue"); } $(function() { // Initialization toggle_color(); // Binding collapse / expand event $("#mycollapsible").bind('expand', function() { toggle_color(); }).bind('collapse', function() { toggle_color(); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;My Title&lt;/h1&gt; &lt;/div&gt; &lt;!-- /header --&gt; &lt;div data-role="content"&gt; &lt;p&gt;Hello world&lt;/p&gt; &lt;div id="mycollapsible" data-role="collapsible-set" data-iconpos="right" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-l"&gt; &lt;div data-role="collapsible" data-collapsed="true" &gt; &lt;h3&gt;Section 1&lt;/h3&gt; &lt;p&gt;I'm the collapsible set content for section 1.&lt;/p&gt; &lt;/div&gt; &lt;div data-role="collapsible" data-collapsed="true"&gt; &lt;h3&gt;Section 2&lt;/h3&gt; &lt;p&gt;I'm the collapsible set content for section 2.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- /content --&gt; &lt;/div&gt; &lt;!-- /page --&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Hope this helps ;)</p>
 

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