Easyui 中 Tabsr的常用方法

注:index必须为变量

     tab页从0开始

//新增一个tab页
var index = 0;
$('#tt').tabs('add',{ title: 'Tab'+index, content: '<div style="padding:10px">Content'+index+'</div>', closable: true });

 //关闭第1个tab页

 var index=1;

 $('#tabs').tabs('close', index);

 //选择或显示第1个tab页

 $('#tabs').tabs('select', index);

 //tabs上的tab页数

 var tabs = $('#tt').tabs().tabs('tabs');

 var count=tabs.length;

 //选项卡鼠标经过事件时自动显示tab页

<script type="text/javascript">
  $(function(){
    var tabs = $('#tt').tabs().tabs('tabs');
    for(var i=0; i<tabs.length; i++){
      tabs[i].panel('options').tab.unbind().bind('mouseenter',{index:i},function(e){
        $('#tt').tabs('select', e.data.index);
      });
    }
  });
</script>

 
原文地址:https://www.cnblogs.com/hailexuexi/p/4894744.html