我正在尝试在jquery tabview.on('SelectionChange')
中重新分配所选YUI TabView的索引,我无法在jquery中重新分配tabindex,请查看下面的代码。
<script
src="<?php echo Yii::app()->request->baseUrl; ?>/js/yui-min.js"></script>
<body class="yui3-skin-sam"> <!-- You need this skin class -->
<div id="demo">
<ul>
<li><a href="#foo">foo</a></li>
<li><a href="#bar">bar</a></li>
<li><a href="#baz">baz</a></li>
</ul>
<div>
<div id="foo">foo content</div>
<div id="bar">bar content</div>
<div id="baz">baz content</div>
</div>
</div>
<script>
YUI().use('tabview', function(Y) {
var tabview = new Y.TabView({
srcNode: '#demo'
});
tabview.render();
tabview.on('selectionChange', function (e) {
alert(tabview.indexOf(e.newVal)); // How to change its index here
});
});
</script>
<?php echo CHtml::textField('tab', '', array('id' => 'tab_id')); ?>
</body>
请任何人指导我设置所选标签的新索引。