You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhky/web/js/tabImgLabel.js

84 lines
3.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

var TabImgLabelClass={
currentNumber:0,
border1:"images/tab/tab_border_1.gif", //第一个tab被选中时上侧边框
border2:"images/tab/tab_border_2.gif", //非最后一个tab被选中时下侧边框
border3:"images/tab/tab_border_3.gif", //非第一个tab未被选中时下侧或上侧边框
border4:"images/tab/tab_border_4.gif", //非第一个tab被选中时上侧边框
border5:"images/tab/tab_border_5.gif", //最后一个tab未被选中时下侧边框
border6:"images/tab/tab_border_6.gif", //最后一个tab被选中时下侧边框
border7:"images/tab/tab_border_7.gif", //第一个tab未被选中时上侧边框
labelSuffix:"images/tab/tab_label",
tabImgLabelClick:function(idNumber,pageUrl,targetObj){
if(idNumber==this.currentNumber)return;
var labelObjs=document.all.tabLabel;
var borderObjs=document.all.tabBorder;
if(idNumber==0){ //点击第一个
if(labelObjs.length==1||labelObjs.length==undefined){ //只有一个
}else{
for(i=0;i<borderObjs.length;i++){
if(i==0){
borderObjs[i].src=this.border1;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_3.gif";
}else if(i==1){
borderObjs[i].src=this.border2;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}else if(i!=borderObjs.length-1){
borderObjs[i].src=this.border3;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}else{
borderObjs[i].src=this.border5;
}
}
}
}else if(idNumber==labelObjs.length-1){ //点击最后一个
for(i=0;i<borderObjs.length;i++){
if(i==0){
borderObjs[i].src=this.border7;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}else if(i==borderObjs.length-2){
borderObjs[i].src=this.border4;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_3.gif";
}else if(i==borderObjs.length-1){
borderObjs[i].src=this.border6;
}else{
borderObjs[i].src=this.border3;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}
}
}else{ //点击中间
for(i=0;i<borderObjs.length;i++){
if(i==0){
borderObjs[i].src=this.border7;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}else if(i<borderObjs.length-2){
if(idNumber==i){
borderObjs[i].src=this.border4;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_3.gif";
}else if((idNumber+1)==i){
borderObjs[i].src=this.border2;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}else{
borderObjs[i].src=this.border3;
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}
}else if(i==borderObjs.length-2){
if((idNumber+1)==i){
borderObjs[i].src=this.border2;
}else{
borderObjs[i].src=this.border3;
}
labelObjs[i].src=this.labelSuffix+"_"+(i+1)+"_1.gif";
}else if(i==borderObjs.length-1){
borderObjs[i].src=this.border5;
}
}
}
this.currentNumber=idNumber;
targetObj.action=pageUrl;
targetObj.submit();
}
};