Javascript操作XML,HTML - 第二部分,HTML - 3



//设置活动工作区

function showWorkArea(iWorkAreaId){

if(iWorkAreaId>0){

var tabs=document.getElementById("tabs");

var oCel=tabs.cells.item(iWorkAreaId);

var panels=document.getElementById("panels");

var oRow=panels.rows.item(iWorkAreaId);

if(oCel){

oCel.className="tab_active";

}

if(oRow){

oRow.style.display="block";

}

currWorkAreaId=iWorkAreaId;

}

}





//关闭工作区

function closeWorkArea(){

var obj = event.srcElement;

if(obj.nodeName != "TD"){

obj = obj.parentNode;

}

var celIndex=obj.cellIndex;

if(currWorkAreaId==celIndex){

hiddenWorkArea(currWorkAreaId);

showWorkArea(celIndex-1);

}

var tabs=document.getElementById("tabs");

tabs.deleteCell(celIndex);

var panels=document.getElementById("panels");

panels.deleteRow(celIndex);

if(tabs.cells.length>1){

tabs.parentNode.parentNode.width=100*(tabs.cells.length-1);

}else{

tabs.parentNode.parentNode.width=100;

}

}





//设置上一个工作区为活动工作区

function gotoPreWorkArea(){

if(currWorkAreaId>1){

hiddenWorkArea(currWorkAreaId);

showWorkArea(currWorkAreaId-1);

}

}





//设置下一个工作区为活动工作区

function gotoNextWorkArea(){

var tabs=document.getElementById("tabs");

if(currWorkAreaId<tabs.cells.length-1){

hiddenWorkArea(currWorkAreaId);

showWorkArea(currWorkAreaId+1);

}

}





代码3

css.css样式表文件

.tab_active {

background-repeat: repeat-x;

border: 1px groove #3366CC;

background-color: #FF6600;

}

.tab_inActive {

background-repeat: repeat-x;

border: 1px ridge #3333CC;

background-color: #669900;

}

body {

margin-left: 0px;

margin-top: 0px;

margin-right: 0px;

margin-bottom: 0px;

}





link1.htm

link2.htm

link3.htm

link4.htm

link5.htm任意弄几个htm文件即可

你可能感兴趣的:(JavaScript,html,xml,css,活动)