MediaWiki:Common.js: Difference between revisions

From Wikimedia Foundation Governance Wiki
Content deleted Content added
Cary Bass (talk | contribs)
No edit summary
Cary Bass (talk | contribs)
No edit summary
Line 20: Line 20:


function changeColor(tabNo,inOut){
function changeColor(tabNo,inOut){
var tabNames = new Array("Tab1","Tab2","Tab3");
var tabObj = document.getElementById(tabNames[tabNo+1]);
if(currentTab==tabNo){
if(currentTab==tabNo){
if(inOut==0){
if(inOut==0){
this.style.background='#EAEAC3';
tabObj.style.background='#EAEAC3';
} else {
} else {
this.style.background='#F9F9E3';
tabObj.style.background='#F9F9E3';
}
}
} else {
} else {
if(inOut==0){
if(inOut==0){
this.style.background='#DADAA3';
tabObj.style.background='#DADAA3';
} else {
} else {
this.style.background='#E9E9C3';
tabObj.style.background='#E9E9C3';
}
}
}
}

Revision as of 20:40, 9 November 2007

/* Any JavaScript here will be loaded for all users on every page load. */
var currentTab = 1;

function showHideTabs(tabNo){
  if(tabNo==1){
    document.getElementById('table1').style.display='';
    document.getElementById('table2').style.display='none';
    document.getElementById('table3').style.display='none';
  } else if(tabNo==2){
    document.getElementById('table1').style.display='none';
    document.getElementById('table2').style.display='';
    document.getElementById('table3').style.display='none';
  } else if(tabNo==3){
    document.getElementById('table1').style.display='none';
    document.getElementById('table2').style.display='none';
    document.getElementById('table3').style.display='';
  }
var currentTab = tabNo;
}

function changeColor(tabNo,inOut){
  var tabNames = new Array("Tab1","Tab2","Tab3");
  var tabObj = document.getElementById(tabNames[tabNo+1]);
  if(currentTab==tabNo){
    if(inOut==0){
      tabObj.style.background='#EAEAC3';
    } else {
      tabObj.style.background='#F9F9E3';
    }
  } else {  
    if(inOut==0){
      tabObj.style.background='#DADAA3';
    } else {
      tabObj.style.background='#E9E9C3';
    }
  }
}