Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>"indexOf" actually works if you use the "tabview.get('selection')" as the argument.</p> <p>Example:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;script type="text/javascript" charset="utf-8" src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;body class="yui3-skin-sam"&gt; &lt;p id="msg"&gt;&lt;/p&gt; &lt;input type='button' value='Button' id='button'/&gt; &lt;div id="demo"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#foo"&gt;foo&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#bar"&gt;bar&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#baz"&gt;baz&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div&gt; &lt;div id="foo"&gt;foo content&lt;/div&gt; &lt;div id="bar"&gt;bar content&lt;/div&gt; &lt;div id="baz"&gt;baz content&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; var YUI; YUI().use('event', 'node', 'tabview', function (Y) { Y.one('#msg').set('innerHTML', 'message area'); var tabview = new Y.TabView({srcNode: '#demo'}); tabview.render(); var displayIndex = function (tabview) { var sel = tabview.get('selection'); var idx = tabview.indexOf(sel); Y.one('#msg').set('innerHTML', 'Selected Tab Index = ' + idx); } displayIndex(tabview); Y.after('click', function(e) { displayIndex(this); },'body',tabview); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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.
    3. 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