我正在尝试添加“创建”选项卡菜单,但当用户单击“保存并继续”按钮时,我希望向用户显示新选项卡。
使用以下脚本
<script>
$(function () 
{
     var $tabs = $("#tabs");
     $tabs.tabs();
     $tabs.tabs("option", 'disabled', [1, 2, 3]);
     function getSelectedTabIndex() 
     {
          return $tabs.tabs('option', 'selected');
     }
     $("#goNext").click(function () 
     {
          var b = getSelectedTabIndex() + 1;
          $tabs.tabs('enable', b);
          $tabs.tabs('option', 'active', b);
          $tabs.tabs('option', 'selected', b);
      });
});
</script>发布于 2014-02-03 06:22:46
在Jquery 活动的中,尝试以下内容
$( "#tabs" ).tabs( {active:1});
// activate next tab
$( "#tabs" ).tabs( "option", "active", tabCounter-1 );演示链接http://jsfiddle.net/dhana36/y2U5u/
发布于 2014-02-03 06:07:28
试试下面的代码..。
也住在这里演示 ..。
步骤1:创建选项卡
<div style="margin-bottom:10px">
    <a href="#" class="easyui-linkbutton" onclick="addTab('google','http://www.google.com')">google</a>
    <a href="#" class="easyui-linkbutton" onclick="addTab('jquery','http://jquery.com/')">jquery</a>
    <a href="#" class="easyui-linkbutton" onclick="addTab('easyui','http://jeasyui.com/')">easyui</a>
</div>
<div id="tt" class="easyui-tabs" style="width:400px;height:250px;">
    <div title="Home">
    </div>
</div>步骤2:实现“addTab”函数
function addTab(title, url){
    if ($('#tt').tabs('exists', title)){
        $('#tt').tabs('select', title);
    } else {
        var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';
        $('#tt').tabs('add',{
            title:title,
            content:content,
            closable:true
        });
    }
}https://stackoverflow.com/questions/21520351
复制相似问题