Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This should do the trick : <a href="http://jsfiddle.net/BLGUW/" rel="nofollow">http://jsfiddle.net/BLGUW/</a></p> <p>HTML :</p> <pre><code>&lt;div class="tabs"&gt; &lt;ul&gt; &lt;li class="active"&gt;&lt;a href="#tab4"&gt;Tab 4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab5"&gt;&lt;div class="alert-icon"&gt;Tab 5&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab6"&gt;&lt;div class="printer-icon"&gt;Tab 6&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tab4" class="tab-content"&gt;Tab 4&lt;/div&gt; &lt;div id="tab5" class="tab-content"&gt;Tab 5 &lt;/div&gt; &lt;div id="tab6" class="tab-content"&gt;Tab 6 &lt;/div&gt; &lt;/div&gt; &lt;div class="tabs"&gt; &lt;ul&gt; &lt;li class="active"&gt;&lt;a href="#tab40"&gt;Tab 4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab50"&gt;&lt;div class="alert-icon"&gt;Tab 5&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab60"&gt;&lt;div class="printer-icon"&gt;Tab 6&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tab40" class="tab-content"&gt;Tab 4&lt;/div&gt; &lt;div id="tab50" class="tab-content"&gt;Tab 5 &lt;/div&gt; &lt;div id="tab60" class="tab-content"&gt;Tab 6 &lt;/div&gt; &lt;/div&gt; </code></pre> <p>JS</p> <pre><code>$(document).ready(function(){ $(".tabs li").click(function() { $(this).parent().parent().find(".tab-content").hide(); var selected_tab = $(this).find("a").attr("href"); $(selected_tab).fadeIn(); $(this).parent().find("li").removeClass('current'); $(this).addClass("current"); return false; }); }); </code></pre> <p>I'm sure this can be optimized ;)</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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