找了一段代码,因为js学艺不精, 想增加一个功能,可以人工指定切换到某个tab, 实现出错了各位还是看 演示吧
http://www.cycoo.net/demo/tab_test.html  tab 鼠标移动切换没有问题。 请高手指教,或知道怎么改的请留下QQ ,我向您求教~!

解决方案 »

  1.   

    参见:http://www.easyui.org.cn/MagicSwitch_demo.html可以实现你要的功能。
      

  2.   

    没有初始化导致
    this.hoverTab=function(IndexID){
    try{
    this.init();
    alert('this.curTabIndex='+this.curTabIndex);
    if(this.curTabIndex==IndexID){return;}
    Dom.removeClass('cur', this.eTabs[this.curTabIndex]);
    Dom.addClass('cur', this.eTabs[IndexID]);
    var temC = this.curTabIndex;
    var temT = IndexID;
    this.curTabIndex = IndexID;
    alert('当前序号='+temC);
    alert('目标序号='+temT);
    this.changeContent(temC, temT); }catch(e){alert('Error 2!');}

    }