Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery UI Tabs adds classes to wrong div?
    primarykey
    data
    text
    <p>I'm trying to use jQuery UI 1.7.2 to add tabs on the fly. First, I create the div that holds the content that belongs in the tab, and then I call $('#tabs').tabs("add",...). jQuery UI correctly adds a new li in the tabs list. However, instead of creating a class attribute on my tab div, it creates a whole new tab div with some bogus id, and creates the class on that.</p> <p>Here's the mark-up it generates:</p> <pre><code>&lt;div id="tabs" class="ui-tabs ui-widget ui-widget-content"&gt; &lt;ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"&gt; &lt;li class="ui-state-default"&gt;&lt;a href="#ui-tabs-41"&gt;&lt;span&gt;Tab 1&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="ui-state-default"&gt;&lt;a href="#ui-tabs-36"&gt;&lt;span&gt;Tab 2&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="ui-state-default"&gt;&lt;a href="#ui-tabs-27"&gt;&lt;span&gt;Tab 3&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="MyTab1"&gt;&lt;img src="/1.jpg"/&gt;&lt;/div&gt; &lt;div id="ui-tabs-41" class="ui-tabs-panel ui-widget-content ui-tabs-hide"/&gt; &lt;div id="ui-tabs-36" class="ui-tabs-panel ui-widget-content ui-tabs-hide"/&gt; &lt;div id="ui-tabs-27" class="ui-tabs-panel ui-widget-content"/&gt; &lt;div id="MyTab2"&gt;&lt;img src="/2.jpg"/&gt;&lt;/div&gt; &lt;div id="MyTab3"&gt;&lt;img src="/3.jpg"/&gt;&lt;/div&gt; </code></pre> <p></p> <p>The divs like MyTab1, etc. are the ones I want to be turned into tabs. The divs like ui-tabs-41 are the ones that jQuery UI decides to generate on its own... and I don't know why.</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.
 

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