Posted By

nealwatkins on 07/13/07


Tagged

tabs


Versions (?)

tabs


 / Published in: JavaScript
 

URL: tabs

tabs

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5. <title>Untitled</title>
  6. <style type="text/css" media="screen"> #schedTableMain {display:none;} #standTableMain {} #broadTableMain {display:none;}
  7. </style>
  8.  
  9. <script type="text/javascript" language="Javascript">
  10. function setHPTab(iMode) {
  11. var standTabImg = document.getElementById('standingTab');
  12. var schedTabImg = document.getElementById('scheduleTab');
  13. var broadTabImg = document.getElementById('broadcastTab');
  14.  
  15. if (iMode == 0) {
  16. standTabImg.src = 'standings_0.gif';
  17. broadTabImg.src = 'broadcast_0.gif';
  18. schedTabImg.src = 'schedule_0.gif';
  19. displayLayers('schedTableMain','','block', 'standTableMain','','none', 'broadTableMain','','none');
  20. } else if (iMode == 1) {
  21. standTabImg.src = 'standings_1.gif';
  22. broadTabImg.src = 'broadcast_1.gif';
  23. schedTabImg.src = 'schedule_1.gif';
  24. displayLayers('schedTableMain','','none', 'standTableMain','','block', 'broadTableMain','','none');
  25. } else {
  26. standTabImg.src = 'standings_1.gif';
  27. broadTabImg.src = 'broadcast_1.gif';
  28. schedTabImg.src = 'schedule_0.gif';
  29. displayLayers('schedTableMain','','none', 'standTableMain','','none', 'broadTableMain','','block');
  30. }
  31. }
  32.  
  33. // multiple layer display
  34.  
  35. function MM_findObj(n, d) { //v4.01
  36. var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  37. d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  38. if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  39. for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  40. if(!x && d.getElementById) x=d.getElementById(n); return x;
  41. }
  42. function displayLayers() {
  43. var i,p,v,obj,args=displayLayers.arguments;
  44. for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
  45. if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }
  46. obj.display=v; }
  47. }
  48. function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  49. var obj = MM_findObj(objName);
  50. if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
  51. if (theValue == true || theValue == false)
  52. eval("obj."+theProp+"="+theValue);
  53. else eval("obj."+theProp+"='"+theValue+"'");
  54. }
  55. }
  56.  
  57. </script>
  58.  
  59. </head>
  60.  
  61. <body>
  62.  
  63.  
  64. <div id="schedstandTableButtons"> <a href="javascript:setHPTab(0);"><img id="scheduleTab" alt="" src="schedule_0.gif" name="scheduleTab" /></a>
  65. <a href="javascript:setHPTab(1);">
  66. <img id="standingTab" alt="" src="standings_0.gif" name="standingTab" /></a>
  67. <a href="javascript:setHPTab(2);"><img id="broadcastTab" alt="" src="broadcast_0.gif" name="broadcastTab" /></a>
  68. </div>
  69.  
  70.  
  71.  
  72. <div id="schedTableMain">
  73. <div id="schedTableHeader"></div>
  74. <div id="scheduleTable">
  75. SCHEDULE
  76. </div>
  77. </div>
  78.  
  79.  
  80. <div id="standTableMain">
  81. <div id="standTableHeader"></div>
  82. <div id="standingsTable">
  83. STANDINGS
  84. </div>
  85. </div>
  86.  
  87.  
  88. <div id="broadTableMain">
  89. <div id="broadTableHeader"></div>
  90. <div id="broadcastTable">
  91. BROADCAST
  92. </div>
  93. </div>

Report this snippet  

You need to login to post a comment.