按钮点击,才调入一个页面,在IE8和FIREFOX如何兼容?
就像114啦网址导航网的名站导航那样的效果,我想在上面有几个按钮控件点击,下面框架就调入一个IFRAME页面,请问如何实现!!问题出在哪?在IE8和FIREFOX下代码是...
就像114啦网址导航网的名站导航那样的效果,我想在上面有几个按钮控件点击,下面框架就调入一个IFRAME页面,请问如何实现!! 问题出在哪?
在IE8和FIREFOX下代码是失效的。应该如何修改。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function selectTag(showContent,selfObj){
var tag = document.getElementById("mbox_th").getElementsByTagName("span");
var taglength = tag.length;
for(i=0; i<taglength; i++){
tag[i].className = "";
}
selfObj.className = "focu";
for(i=0; j=document.getElementById("mbox"+i); i++){
j.style.display = "none";
}
document.getElementById(showContent).style.display = "block";
}
</script>
<style type="text/css" >
#rc3 {
margin:5px 0px 4px 0px;TEXT-ALIGN: center; WIDTH: 975px;HEIGHT: 24px; FLOAT: left; !important
}
.mbox{
MARGIN-TOP: 28px;border:1px solid #b9d4e2;
}
.mbox_border{
BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; BORDER-RIGHT-STYLE: none; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; PADDING-TOP: 0px
}
#mbox0,#mbox1,#mbox2{
PADDING-BOTTOM: 0px; BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; CLEAR: both; BORDER-LEFT-WIDTH: 0px; PADDING-TOP: 0px
}
#rc3 #mbox_th {
PADDING-LEFT: 0px; HEIGHT: 24px; COLOR: #000; FONT-SIZE: 12px; OVERFLOW: hidden
}
#rc3 #mbox_th SPAN {
TEXT-ALIGN: center; LINE-HEIGHT: 27px; MARGIN-TOP: 0px; WIDTH: 97px; FLOAT: left; HEIGHT: 23px; OVERFLOW: hidden; CURSOR: pointer
}
#rc3 #mbox_th SPAN{
background-repeat: no-repeat;
color:#000;
}
#rc3 #mbox_th .focu {
BACKGROUND: url(gbox_tag_focu.gif); CURSOR: text;
}
</style>
</head>
<body>
<DIV id=rc3>
<DIV id=mbox_th>
<SPAN onclick="selectTag('mbox9',this);if(document.getElementById('mbox1').src=='') document.getElementById('mbox9').src='gw.htm'"><a href="#">购物</a></SPAN>
<SPAN onclick="selectTag('mbox2',this);if(document.getElementById('mbox2').src=='') document.getElementById('mbox2').src='gp.htm'"><a href="#">股票</a></SPAN>
</DIV> </DIV>
<DIV class="mbox">
<DIV class="mbox_border"><IFRAME id="mbox1" height="160" marginHeight="0" src="" frameBorder=0 width="970" marginWidth="0" scrolling="no"></IFRAME></DIV>
<DIV class="mbox_border"><IFRAME id="mbox2" height="270" marginHeight="0" src="" frameBorder=0 width="970" marginWidth="0" scrolling="no"></IFRAME></DIV>
</DIV>
</body>
</html> 展开
在IE8和FIREFOX下代码是失效的。应该如何修改。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function selectTag(showContent,selfObj){
var tag = document.getElementById("mbox_th").getElementsByTagName("span");
var taglength = tag.length;
for(i=0; i<taglength; i++){
tag[i].className = "";
}
selfObj.className = "focu";
for(i=0; j=document.getElementById("mbox"+i); i++){
j.style.display = "none";
}
document.getElementById(showContent).style.display = "block";
}
</script>
<style type="text/css" >
#rc3 {
margin:5px 0px 4px 0px;TEXT-ALIGN: center; WIDTH: 975px;HEIGHT: 24px; FLOAT: left; !important
}
.mbox{
MARGIN-TOP: 28px;border:1px solid #b9d4e2;
}
.mbox_border{
BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; BORDER-RIGHT-STYLE: none; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; PADDING-TOP: 0px
}
#mbox0,#mbox1,#mbox2{
PADDING-BOTTOM: 0px; BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; CLEAR: both; BORDER-LEFT-WIDTH: 0px; PADDING-TOP: 0px
}
#rc3 #mbox_th {
PADDING-LEFT: 0px; HEIGHT: 24px; COLOR: #000; FONT-SIZE: 12px; OVERFLOW: hidden
}
#rc3 #mbox_th SPAN {
TEXT-ALIGN: center; LINE-HEIGHT: 27px; MARGIN-TOP: 0px; WIDTH: 97px; FLOAT: left; HEIGHT: 23px; OVERFLOW: hidden; CURSOR: pointer
}
#rc3 #mbox_th SPAN{
background-repeat: no-repeat;
color:#000;
}
#rc3 #mbox_th .focu {
BACKGROUND: url(gbox_tag_focu.gif); CURSOR: text;
}
</style>
</head>
<body>
<DIV id=rc3>
<DIV id=mbox_th>
<SPAN onclick="selectTag('mbox9',this);if(document.getElementById('mbox1').src=='') document.getElementById('mbox9').src='gw.htm'"><a href="#">购物</a></SPAN>
<SPAN onclick="selectTag('mbox2',this);if(document.getElementById('mbox2').src=='') document.getElementById('mbox2').src='gp.htm'"><a href="#">股票</a></SPAN>
</DIV> </DIV>
<DIV class="mbox">
<DIV class="mbox_border"><IFRAME id="mbox1" height="160" marginHeight="0" src="" frameBorder=0 width="970" marginWidth="0" scrolling="no"></IFRAME></DIV>
<DIV class="mbox_border"><IFRAME id="mbox2" height="270" marginHeight="0" src="" frameBorder=0 width="970" marginWidth="0" scrolling="no"></IFRAME></DIV>
</DIV>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询