Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Related:</p> <ul> <li><a href="https://stackoverflow.com/questions/6650856/specifying-the-styles-for-the-selected-tab-in-a-navbar/6651134#6651134">Specifying the styles for the selected tab in a navbar</a></li> </ul> <p>Live Example:</p> <ul> <li><a href="http://jsfiddle.net/phillpafford/8pwFK/29/" rel="nofollow noreferrer">http://jsfiddle.net/phillpafford/8pwFK/29/</a></li> </ul> <p>JS:</p> <pre><code>$('#custom-li-1').click(function() { $(this).attr('data-icon','star'); $(this).children().children().next().removeClass('ui-icon-custom').addClass('ui-icon-star'); }).page(); $('#custom-li-2').click(function() { $(this).attr('data-icon','home'); $(this).children().children().next().removeClass('ui-icon-grid').addClass('ui-icon-home'); }).page(); $('#custom-li-3').click(function() { $(this).attr('data-icon','grid'); $(this).children().children().next().removeClass('ui-icon-star').addClass('ui-icon-grid'); }).page(); </code></pre> <p>HTML:</p> <pre><code>&lt;div data-role="page" id="home"&gt; &lt;div data-role="header" data-theme="b"&gt; &lt;h1&gt;Test&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content" data-theme="d"&gt; &lt;div data-role="navbar" data-theme="d"&gt; &lt;ul id="custom-nav-list"&gt; &lt;li&gt;&lt;a href="#" data-icon="custom" class="ui-btn-active" id="custom-li-1"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" data-icon="grid" id="custom-li-2"&gt;Second page&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" data-icon="star" id="custom-li-3"&gt;Third page&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&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. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    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