js浏览器 兼容问题。八百里加急! 本帖最后由 chengliwangtao 于 2011-01-12 13:04:54 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个不是js的问题 是css样式的问题吧楼主应该说哈在啥浏览器下乱? 另外backgroundColor常规写法是:background-colorborderBottom --> border-bottom你这样改了以后试试看 #dNavBar{background-color:#F74461;width:950px;float:left; margin-top:50px;}#lgo{float:left; width:20%;height:150px;background-color:#8D8EA2; }#dNavBar li{list-style-type:none;float:left;width:85px;height:35px;line-height:35px;font-size:14px;color:#FFFFFF;background-color:#F74461;text-align:center;display:block;cursor:pointer;}#subMenu{background-color:#666688;width:950px;text-align:left;border-right:3px solid #ffffff;height:35px;line-height:35px;color:#FFFFFF;font-size:14px;}这是css 样式 ! CSS里面 #dNavBar{margin-top:50px;}和 #subMenu{height:35px}删掉 试试是不是要这个效果 帮你看了下。是CSS问题!<!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 runat="server"><title>无标题页</title><script language="javascript" type="text/javascript">function iniPage(){ var barCTT=document.getElementById("dNavBar") var liArr=barCTT.getElementsByTagName("li") var links=new Array() links[0]="<a style='margin-left:50px;text-align:left;' href='user/Miniindex.aspx' >网站首页</a>" links[1]="<a style='margin-left:50px;' href='user/mood.aspx' target='LeftForm'>语录</a> <a href='Usercontrol/send.aspx'>留言</a> " links[2]="<a style='margin-left:50px;' href='user/lgowr.aspx'>日记</a> <a href='user/logtwo.aspx'>情侣日记</a> <a href='user/shouchang.aspx'>收藏日记</a> <a href='user/addlog.aspx'>发表日志</a>" links[3]="<a style='margin-left:50px;' href='http:///?cat=3'>您自定义</a> <a href='http:///?cat=2'>您自定义</a> <a href='http:///?cat=2'>您自定义</a>" links[4]="<a style='margin-left:50px;' href='http:///?cat=1'>您自定义</a> <a href='http:///?cat=1'>您自定义</a>" for (i=0;i<liArr.length;i++) { liArr[i].onclick=function() { selectThis(this,liArr,links) } }}function selectThis(indexObj,allLi,infoArr){ var index=0; for (i=0;i<allLi.length;i++) { allLi[i].style.backgroundColor="#F74461"; allLi[i].style.height="35px"; if (indexObj==allLi[i]) { index=i; } } indexObj.style.borderBottom="0px solid #666688"; indexObj.style.backgroundColor="#666688"; indexObj.style.height="35px"; document.getElementById("subMenu").innerHTML=infoArr[index];}</script><style>*{margin:0;padding:0;}.clearfix:after { content:"."; display:block;height:0;clear:both; visibility:hidden;} *html .clearfix{height:1%;}*+html .clearfix{height:1%;}.clearfix{display:inline-block;} /* Hide from IE Mac */ .clearfix {display:block;} #dNavBar{background-color:#F74461;width:950px;height:35px;}#lgo{width:20%;height:150px;background-color:#8D8EA2;}#dNavBar li{list-style:none;float:left;display:inline;width:85px;height:35px;line-height:35px;font-size:14px;color:#fff;background-color:#F74461;text-align:center;cursor:pointer;}#subMenu{background-color:#666688;width:950px;text-align:left;height:35px;line-height:35px;color:#FFFFFF;font-size:14px;}.win{height:70px;overflow:hidden;}</style></head><body onLoad="iniPage()"><form id="form1" method="post"> <div class="win"> <ul id="dNavBar" class="clearfix"> <li>首页</li> <li>MINE</li> <li>日记本</li> <li>随便逛逛</li> <li>商量</li> </ul> <div id="subMenu"> </div> </div> <div class="didi" style="text-align:center; width:100%;margin:0 auto; font-size:12px;"> <a href="#">网站宗旨</a>||<a href="#">关于我们</a>||<a href="#">开发团队</a>||<a href="#">联系我们</a> </div></form></body></html> liArr[i].onmouseover=function()一般都是鼠标划过即变。点击不直接。 获取年份 在视频前加播广告的程序 google maps api 我只要部分信息,其他不显示行吗? js 怎麼設置打印份數 javascript一个下拉列表的数据写入另一个下拉列表 问个简单问题~! 请问一下,textarea框,输入字符串以后,即时显示还能输入多少个字,是怎么实现的? 如何用正则表达式提取网页内容? 增加一行UL,怎么让它产生序号?并且这里删除事件怎么写? 分辨率改变之后下拉菜单(层)位置错乱怎么解决? Ext 高手请进,关于Ext.ux.form.SpinnerField 求教:
楼主应该说哈
在啥浏览器下乱?
borderBottom --> border-bottom你这样改了以后试试看
background-color:#F74461;
width:950px;
float:left;
margin-top:50px;
}
#lgo
{
float:left;
width:20%;
height:150px;
background-color:#8D8EA2;
}
#dNavBar li{
list-style-type:none;
float:left;
width:85px;
height:35px;
line-height:35px;
font-size:14px;
color:#FFFFFF;
background-color:#F74461;
text-align:center;
display:block;
cursor:pointer;
}
#subMenu{
background-color:#666688;
width:950px;
text-align:left;
border-right:3px solid #ffffff;
height:35px;
line-height:35px;
color:#FFFFFF;
font-size:14px;
}
这是css 样式 !
}和
#subMenu{height:35px}删掉 试试是不是要这个效果
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script language="javascript" type="text/javascript">
function iniPage()
{
var barCTT=document.getElementById("dNavBar")
var liArr=barCTT.getElementsByTagName("li") var links=new Array()
links[0]="<a style='margin-left:50px;text-align:left;' href='user/Miniindex.aspx' >网站首页</a>"
links[1]="<a style='margin-left:50px;' href='user/mood.aspx' target='LeftForm'>语录</a> <a href='Usercontrol/send.aspx'>留言</a> "
links[2]="<a style='margin-left:50px;' href='user/lgowr.aspx'>日记</a> <a href='user/logtwo.aspx'>情侣日记</a> <a href='user/shouchang.aspx'>收藏日记</a> <a href='user/addlog.aspx'>发表日志</a>"
links[3]="<a style='margin-left:50px;' href='http:///?cat=3'>您自定义</a> <a href='http:///?cat=2'>您自定义</a> <a href='http:///?cat=2'>您自定义</a>"
links[4]="<a style='margin-left:50px;' href='http:///?cat=1'>您自定义</a> <a href='http:///?cat=1'>您自定义</a>" for (i=0;i<liArr.length;i++)
{
liArr[i].onclick=function()
{
selectThis(this,liArr,links)
}
}
}
function selectThis(indexObj,allLi,infoArr)
{
var index=0;
for (i=0;i<allLi.length;i++)
{ allLi[i].style.backgroundColor="#F74461";
allLi[i].style.height="35px";
if (indexObj==allLi[i])
{
index=i;
}
}
indexObj.style.borderBottom="0px solid #666688";
indexObj.style.backgroundColor="#666688";
indexObj.style.height="35px"; document.getElementById("subMenu").innerHTML=infoArr[index];
}</script>
<style>
*{margin:0;padding:0;}
.clearfix:after
{ content:"."; display:block;height:0;clear:both; visibility:hidden;}
*html .clearfix{height:1%;}
*+html .clearfix{height:1%;}
.clearfix{display:inline-block;}
/* Hide from IE Mac */
.clearfix {display:block;} #dNavBar{background-color:#F74461;width:950px;height:35px;}
#lgo{width:20%;height:150px;background-color:#8D8EA2;}
#dNavBar li{list-style:none;float:left;display:inline;width:85px;height:35px;line-height:35px;font-size:14px;color:#fff;background-color:#F74461;text-align:center;cursor:pointer;}
#subMenu{background-color:#666688;width:950px;text-align:left;height:35px;line-height:35px;color:#FFFFFF;font-size:14px;}
.win{height:70px;overflow:hidden;}
</style>
</head>
<body onLoad="iniPage()">
<form id="form1" method="post">
<div class="win">
<ul id="dNavBar" class="clearfix">
<li>首页</li>
<li>MINE</li>
<li>日记本</li>
<li>随便逛逛</li>
<li>商量</li>
</ul>
<div id="subMenu"> </div>
</div>
<div class="didi" style="text-align:center; width:100%;margin:0 auto; font-size:12px;"> <a href="#">网站宗旨</a>||<a href="#">关于我们</a>||<a href="#">开发团队</a>||<a href="#">联系我们</a> </div>
</form>
</body>
</html>