dhtmlXTabBar二次弹出时显示不正常求解

computerbugs 发布于 2012/05/31 16:22
阅读 706
收藏 0

两个div 然后初始化时a_tabbar显示正常,但是点击测试按钮后初始化第二个tabar也就是b_tabbar,虽然已经设置默认显示a5,但是事件处理后不显示a5必须点击一下其他的返回来之后,a5才显示数据。

注意:项目需要导入对应jar再次未导入
 <div id="a_tabbar" style="width:395px; height:390px;"></div>
   
 <div id='html_1'><img src="../common/page_a.gif"></div>
    <div id='html_2'><img src="../common/page_b.gif"></div>
     <div id='html_3'><h2>tttttt</h2></div>
  <input type="button" id="bt" name="bb" onclick="aa()" value="测试"/>
 
  <div id="b_tabbar" style="width:395px; height:390px;display:none;"></div>
     <div id='html_4'><img src="../common/page_a.gif"></div>
        <div id='html_5'><img src="../common/page_b.gif"></div>
        <div id='html_6'><h2>rrrrrr</h2></div>
 
<script>
            tabbar=new dhtmlXTabBar("a_tabbar","top");

            tabbar.setSkin('dhx_skyblue');
            tabbar.setImagePath("../../codebase/imgs/");

        
            tabbar.addTab("a1","Tab 1-1","100px");
            tabbar.addTab("a2","Tab 1-2","100px");
            tabbar.addTab("a3","Tab 1-3","100px");

            tabbar.setContent("a1","html_1");
            tabbar.setContent("a2","html_2");
   tabbar.setContent("a3","html_3");
            //tabbar.setContentHTML("a3","<br/>The content can be set as <b>HTML</b> node or as <b>HTML</b> text.");
           
            tabbar.setTabActive("a2");
            var text = null;
        
      inintTabbar();
  
         tabbar.attachEvent("onSelect",function(){
             e_log("onSelect",arguments);
             return true;
         });
           
            function aa(){
     alert("sss");
     var div = document.getElementById("b_tabbar");
     div.style.display = "block"; 
        
   }
   
   function inintTabbar(){
   tabbar1=new dhtmlXTabBar("b_tabbar","top");

            tabbar1.setSkin('dhx_skyblue');
            tabbar1.setImagePath("../../codebase/imgs/");

        
            tabbar1.addTab("a4","oo","100px");
            tabbar1.addTab("a5","o1","100px");
            tabbar1.addTab("a6","o2","100px");

            tabbar1.setContent("a4","html_4");
            tabbar1.setContent("a5","html_5");
   tabbar1.setContent("a6","html_6");
   
            tabbar1.setTabActive("a5");
   
   }

加载中
返回顶部
顶部