Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The collapse/expand of content is being handled in the <code>click</code> handler of the collapsible heading.So by unbinding the <code>click</code> event you can keep accordion always expanded.</p> <pre><code>$(".ui-collapsible-heading").unbind("click"); </code></pre> <p>A demo here - <a href="http://jsfiddle.net/8dLw4/" rel="nofollow">http://jsfiddle.net/8dLw4/</a></p> <p><strong>Edit</strong></p> <p>Edited fiddle for keeping some in expanded state always- <a href="http://jsfiddle.net/8dLw4/2/" rel="nofollow">http://jsfiddle.net/8dLw4/2/</a></p> <p>An attribute <code>data-allow-collapse</code> is added.For sections you want to allow collapse,set it as <code>true</code>.For other sections <code>false</code>.</p> <p>Here is the complete source code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;jQuery Mobile Sample&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.6.4.min.js"&gt;&lt;/script&gt; &lt;script&gt; $("#page").live('pageinit', function(event) { $(".ui-collapsible[data-allow-collapse=false]").unbind("expand collapse"); }); &lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" id="page"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;Page Title&lt;/h1&gt; &lt;/div&gt;&lt;!-- /header --&gt; &lt;div data-role="content"&gt; &lt;div data-role="collapsible-set"&gt; &lt;div data-role="collapsible" data-collapsed="false" data-allow-collapse="false"&gt; &lt;h3&gt;Section 1-Not allowed&lt;/h3&gt; &lt;p&gt; I'm the collapsible set content for section B. &lt;/p&gt; &lt;/div&gt; &lt;div data-role="collapsible" data-collapsed="false" data-allow-collapse="true"&gt; &lt;h3&gt;Section 2-Allowed&lt;/h3&gt; &lt;p&gt; I'm the collapsible set content for section B. &lt;/p&gt; &lt;/div&gt; &lt;div data-role="collapsible" data-collapsed="false" data-allow-collapse="true"&gt; &lt;h3&gt;Section 3-Allowed&lt;/h3&gt; &lt;p&gt; I'm the collapsible set content for section B. &lt;/p&gt; &lt;/div&gt; &lt;div data-role="collapsible" data-collapsed="false" data-allow-collapse="false"&gt; &lt;h3&gt;Section 4-Not allowed&lt;/h3&gt; &lt;p&gt; I'm the collapsible set content for section B. &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>
    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