help.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. * TAB切换
  37. * @param tabParentId tab的父节点ID或者对象本身
  38. */
  39. function switchTab( tabParentId ) {
  40. var tabElements = $G( tabParentId ).children,
  41. tabHeads = tabElements[0].children,
  42. tabBodys = tabElements[1].children;
  43. for ( var i = 0, length = tabHeads.length; i < length; i++ ) {
  44. var head = tabHeads[i];
  45. if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head );
  46. head.onclick = function () {
  47. clickHandler(tabHeads,tabBodys,this);
  48. }
  49. }
  50. }
  51. switchTab("helptab");
  52. document.getElementById('version').innerHTML = parent.UE.version;