Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have forked this sample from Guillaume and created a new one:</p> <p><a href="http://jsfiddle.net/NSX3d/3/" rel="nofollow">http://jsfiddle.net/NSX3d/3/</a></p> <p>HTML:</p> <pre><code>&lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#fragment-1"&gt;&lt;span&gt;One&lt;/span&gt;&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#fragment-2"&gt;&lt;span&gt;Two&lt;/span&gt;&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#fragment-3"&gt;&lt;span&gt;Three&lt;/span&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div id="fragment-1"&gt; &lt;p&gt;First tab is active by default:&lt;/p&gt; &lt;a class="nexttab" href="#"&gt;Next Tab&lt;/a&gt; &lt;a class="prevtab" href="#"&gt;Previous Tab&lt;/a&gt; &lt;/div&gt; &lt;div id="fragment-2"&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh &lt;a class="nexttab" href="#"&gt;Next Tab&lt;/a&gt; &lt;a class="prevtab" href="#"&gt;Previous Tab&lt;/a&gt; &lt;/div&gt; &lt;div id="fragment-3"&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh &lt;a class="nexttab" href="#"&gt;Next Tab&lt;/a&gt; &lt;a class="prevtab" href="#"&gt;Previous Tab&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>JS:</p> <pre><code> $("#tabs").tabs(); //New version this line is $('#tabs &gt;ul &gt;li').size(); var tabCount = $("#tabs").tabs("length"); $("#tabs &gt; ul &gt; li &gt; a").each(function (index) { if (index == 0) { $($(this).attr('href') + " .prevtab").hide(); } if (index &gt;= tabCount - 1) { $($(this).attr('href') + " .nexttab").hide(); } }); $(".nexttab").click(function () { //new version - active var selected = $("#tabs").tabs("option", "selected"); $("#tabs").tabs("option", "selected", selected + 1); }); $(".prevtab").click(function () { //new version - active var selected = $("#tabs").tabs("option", "selected"); $("#tabs").tabs("option", "selected", selected - 1); }); </code></pre> <p>It has both next and previous buttons</p>
    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.
 

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