懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
提交 | 用户 | 时间
1ac2bc 1 /**
2  * Created with JetBrains PhpStorm.
3  * User: xuheng
4  * Date: 12-9-26
5  * Time: 下午1:06
6  * To change this template use File | Settings | File Templates.
7  */
8 /**
9  * tab点击处理事件
10  * @param tabHeads
11  * @param tabBodys
12  * @param obj
13  */
14 function clickHandler( tabHeads,tabBodys,obj ) {
15     //head样式更改
16     for ( var k = 0, len = tabHeads.length; k < len; k++ ) {
17         tabHeads[k].className = "";
18     }
19     obj.className = "focus";
20     //body显隐
21     var tabSrc = obj.getAttribute( "tabSrc" );
22     for ( var j = 0, length = tabBodys.length; j < length; j++ ) {
23         var body = tabBodys[j],
24             id = body.getAttribute( "id" );
25         body.onclick = function(){
26             this.style.zoom = 1;
27         };
28         if ( id != tabSrc ) {
29             body.style.zIndex = 1;
30         } else {
31             body.style.zIndex = 200;
32         }
33     }
34
35 }
36
37 /**
38  * TAB切换
39  * @param tabParentId  tab的父节点ID或者对象本身
40  */
41 function switchTab( tabParentId ) {
42     var tabElements = $G( tabParentId ).children,
43         tabHeads = tabElements[0].children,
44         tabBodys = tabElements[1].children;
45
46     for ( var i = 0, length = tabHeads.length; i < length; i++ ) {
47         var head = tabHeads[i];
48         if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head );
49         head.onclick = function () {
50             clickHandler(tabHeads,tabBodys,this);
51         }
52     }
53 }
54 switchTab("helptab");
55
56 document.getElementById('version').innerHTML = parent.UE.version;