Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It works fine for me, if I follow the format as in jquery ui's <a href="http://jqueryui.com/tabs/" rel="nofollow noreferrer">tabs documentation</a>,</p> <p>You need to give id to your ul as this,</p> <pre><code>&lt;div class="navigation"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#tabs-1"&gt;ONE&lt;/a&gt;&lt;/li&gt; &lt;li class="sub"&gt; &lt;a href="#tabs-2"&gt;TWO&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#tabs-3"&gt;THREE&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul id="tabs-2" class="submenu"&gt; &lt;li&gt;&lt;a href="ajax/testA.php"&gt;A&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="ajax/testB.php"&gt;B&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="ajax/testC.php"&gt;C&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>Check the <a href="http://jqueryui.com/tabs/" rel="nofollow noreferrer">tabs documentation</a>.</p> <p><strong><a href="http://jsfiddle.net/2rfm5/28/" rel="nofollow noreferrer">JSFIDDLE DEMO 1</a></strong></p> <p>If you are looking for second id to be tabs too,</p> <p><strong><a href="http://jsfiddle.net/2rfm5/30/" rel="nofollow noreferrer">JSFIDDLE DEMO 2</a></strong></p> <p>And after you I saw the link you gave me, the child ul too needs to be tabbed so that you can get contents using ajax, just by providing a href attribute.</p> <p><strong>EDIT,</strong></p> <p>I made two files,</p> <pre><code>maindir - index.html - ajax (directory) -- testB.php </code></pre> <p><strong>index.html,</strong></p> <pre><code>&lt;!DOCTYPE html"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"/&gt; &lt;meta name="description" edit="mootools shell, easy test you snippets before implementing"/&gt; &lt;meta name="keywords" edit="mootools,javascript,javascript framework,shell,test"/&gt; &lt;meta name="robots" edit="all"/&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="http://jqueryui.com/tabs/resources/demos/style.css" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="navigation"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#tabs-1"&gt;ONE&lt;/a&gt;&lt;/li&gt; &lt;li class="sub"&gt; &lt;a href="#tabs-2"&gt;TWO&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#tabs-3"&gt;THREE&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tabs-1"&gt; &lt;p&gt;Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus.&lt;/p&gt; &lt;/div&gt; &lt;div id="tabs-2"&gt; &lt;ul class="submenu"&gt; &lt;li&gt;&lt;a href="ajax/testA.php"&gt;A&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="ajax/testB.php"&gt;B&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="ajax/testC.php"&gt;C&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $( ".navigation" ).tabs(); $("#tabs-2").tabs(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>testB.php,</strong></p> <pre><code>&lt;?php echo "content of B"; ?&gt; </code></pre> <p>And it shows me this,</p> <p><img src="https://i.stack.imgur.com/RHQEq.png" alt="enter image description here"></p> <p>From comments,</p> <blockquote> <p>In jquery-ui, you can directly give link to get content via ajax. Well then the problem is, the children ul li ul li, are not tabbed. I guess if that was tabbed too, then only you can use it to get content via ajax. As in my first fiddle example, you click on an href, it redirects you to show 404. But in second fiddle, it has a link but is tabbed, it does not redirect but gets contents via ajax. So basically you just need to do it like the second example. Just do $("#tab-2").tabs(), this should solve your problem.</p> </blockquote>
 

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