这段代码在ie下显示正常,可以在firefox好像没什么作用,请高手赐教,谢谢! var debug = false ;
function switchTab (tab)
{ event.returnValue = false ;
var tabName = getTabGroupName (tab.id) ;
if (tabName == '')
{ alert ("No tabName for tab [" + tab.id + "]") ;
return ;
}
var index = 1 ;
while (true)
{ var tabTitle = eval ("document.all ('" + tabName + '_' + index + "')") ;
if (tabTitle == undefined)
break ;
deactiveTabTitle (tabTitle , tabName) ;
var tabContent = eval ("document.all ('" + tabName + '_' + index + '_content' + "')") ;
if (tabContent != undefined)
tabContent.style.display = "NONE" ;
index ++ ;
}
if (debug)
alert ("Find " + (index - 1) + " tab title(s) for TabName [" + tabName + "]") ;
activeTabTitle (tab , tabName) ;
var tabContent = eval ("document.all ('" + tab.id + '_content' + "')") ;
if (tabContent != undefined)
tabContent.style.display = "BLOCK" ;
} function cancelTab ()
{
}
function getTabGroupName (tabId)
{
if (tabId == '' ¦ ¦ tabId == undefined)
{
alert ("tabId is NULL! [" + tabId + "]") ;
return ;
}
var i = tabId.lastIndexOf ('_') ;
if (i <= 1)
return '' ;
return tabId.substr (0 , i) ;
}
function deactiveTabTitle (tab , tabName)
{
tab.className = tabName + "_off" ;
} function activeTabTitle (tab , tabName)
{
tab.className = tabName + "_on" ;
}
function switchTab (tab)
{ event.returnValue = false ;
var tabName = getTabGroupName (tab.id) ;
if (tabName == '')
{ alert ("No tabName for tab [" + tab.id + "]") ;
return ;
}
var index = 1 ;
while (true)
{ var tabTitle = eval ("document.all ('" + tabName + '_' + index + "')") ;
if (tabTitle == undefined)
break ;
deactiveTabTitle (tabTitle , tabName) ;
var tabContent = eval ("document.all ('" + tabName + '_' + index + '_content' + "')") ;
if (tabContent != undefined)
tabContent.style.display = "NONE" ;
index ++ ;
}
if (debug)
alert ("Find " + (index - 1) + " tab title(s) for TabName [" + tabName + "]") ;
activeTabTitle (tab , tabName) ;
var tabContent = eval ("document.all ('" + tab.id + '_content' + "')") ;
if (tabContent != undefined)
tabContent.style.display = "BLOCK" ;
} function cancelTab ()
{
}
function getTabGroupName (tabId)
{
if (tabId == '' ¦ ¦ tabId == undefined)
{
alert ("tabId is NULL! [" + tabId + "]") ;
return ;
}
var i = tabId.lastIndexOf ('_') ;
if (i <= 1)
return '' ;
return tabId.substr (0 , i) ;
}
function deactiveTabTitle (tab , tabName)
{
tab.className = tabName + "_off" ;
} function activeTabTitle (tab , tabName)
{
tab.className = tabName + "_on" ;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货