Açıklama Yok

tabs.htc 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <public:component lightweight="true">
  2. <public:attach event="onmouseover" onevent="on()"/>
  3. <public:attach event="onmouseout" onevent="off()"/>
  4. <public:attach event="onresize" onevent="resetTabBar()"/>
  5. <public:attach event="onclick" onevent="down()"/>
  6. <public:attach event="ondocumentready" onevent="load()"/>
  7. <public:attach event="onkeyup" onevent="Key()"/>
  8. <public:event id="eventChange" name="onchange"/>
  9. <public:event id="eventAfterChange" name="onafterchange"/>
  10. <public:method name="down"/>
  11. <public:property name="CurrentTab" get="GetCurrentTab"/>
  12. <public:property name="CurrentTabContent" get="GetCurrentTabContent"/>
  13. <script language="JavaScript">
  14. var _oTab;
  15. function load()
  16. {
  17. var tab;
  18. for (var i = 0; i < this.cells[0].children.length; i++)
  19. {
  20. tab = this.cells[0].children[i];
  21. if (tab.className == "tab tabOn")
  22. {
  23. down(tab, true);
  24. return;
  25. }
  26. }
  27. down(this.cells[0].firstChild, true);
  28. }
  29. function Key()
  30. {
  31. if (event.keyCode == 13)
  32. {
  33. event.srcElement.click();
  34. }
  35. }
  36. function down(oTab, bForce)
  37. {
  38. var o = (oTab) ? oTab : event.srcElement;
  39. if (this.parentElement.document.readyState != "complete" && !bForce)
  40. {
  41. return;
  42. }
  43. if (o.className == "tab" || !_oTab)
  44. {
  45. hrGlowTab.style.display = "none";
  46. var oEvent = createEventObject();
  47. oEvent.tab = o;
  48. oEvent.tabContent = window.document.all(o.tabid);
  49. eventChange.fire(oEvent);
  50. if (oEvent.allowSwitch == false)
  51. {
  52. return;
  53. }
  54. o.className = "tab tabOn";
  55. show(hrSelectedTab,o);
  56. window.document.all(o.tabid).style.display = "inline";
  57. if (_oTab)
  58. {
  59. _oTab.className = "tab";
  60. window.document.all(_oTab.tabid).style.display = "none";
  61. }
  62. _oTab = o;
  63. eventAfterChange.fire(oEvent);
  64. }
  65. }
  66. function on()
  67. {
  68. if(event.srcElement.id != "hrSelectedTab" && event.srcElement.tagName == "SPAN")
  69. {
  70. show(hrGlowTab,event.srcElement);
  71. }
  72. }
  73. function off()
  74. {
  75. hrGlowTab.style.display = "none";
  76. }
  77. function resetTabBar()
  78. {
  79. hrSelectedTab.style.display="none";
  80. var o = GetCurrentTab();
  81. o.className = "tab tabOn";
  82. show(hrSelectedTab,o);
  83. }
  84. function show(oShow, o)
  85. {
  86. try
  87. {
  88. with (oShow.style)
  89. {
  90. left = o.offsetLeft + 1;
  91. width = o.offsetWidth - 2;
  92. display = "inline";
  93. }
  94. var expression = "document.all[\"" + o.id + "\"].offsetTop - 4";
  95. oShow.style.setExpression("top", expression);
  96. }
  97. catch(e)
  98. {}
  99. }
  100. function GetCurrentTab()
  101. {
  102. return _oTab;
  103. }
  104. function GetCurrentTabContent()
  105. {
  106. return window.document.all(_oTab._imgs);
  107. }
  108. </script>
  109. </public:component>