回复 2楼 dzt0001
程序代码:
<html>
<HEAD>
<TITLE></TITLE>
<link href="../css/ej.css" rel="stylesheet" type="text/css" />
<META http-equiv=Content-Type content="text/html; charset=gb2312">
</HEAD>
<BODY >
<DIV id=con>
<UL id=tags>
<LI class=selectTag><A onClick="selectTag('tagContent0',this)"
href="javascript:void(0)"> 美食原料 </A> </LI>
<LI><A onClick="selectTag('tagContent1',this)"
href="javascript:void(0)"> 肉禽蛋营养 </A> </LI>
<LI><A onClick="selectTag('tagContent2',this)"
href="javascript:void(0)"> 水产品营养 </A></LI>
<LI><A onClick="selectTag('tagContent3',this)"
href="javascript:void(0)"> 谷物果蔬营养 </A></LI>
</UL>
<DIV id=tagContent >
<DIV class="tagContent selectTag" id=tagContent0><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更>> </div></td></tr>
</table></DIV>
<DIV class=tagContent id=tagContent1><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更多>> </div></td></tr>
</table></DIV>
<DIV class=tagContent id=tagContent2><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更多>> </div></td></tr>
</table></DIV>
<DIV class=tagContent id=tagContent3><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更多>> </div></td></tr>
</table></DIV>
</DIV>
</DIV>
<SCRIPT type=text/javascript>
function selectTag(showContent,selfObj){
var tag = document.getElementById("tags").getElementsByTagName("li");
var taglength = tag.length;
for(i=0; i<taglength; i++){
tag[i].className = "";
}
selfObj.parentNode.className = "selectTag";
for(i=0; j=document.getElementById("tagContent"+i); i++){
j.style.display = "none";
}
document.getElementById(showContent).style.display = "block";
}
</SCRIPT>
</BODY>
</HTML>
ej.asp
程序代码:
<html>
<HEAD>
<TITLE></TITLE>
<link href="../css/ej2.css" rel="stylesheet" type="text/css" />
<META http-equiv=Content-Type content="text/html; charset=gb2312">
</HEAD>
<BODY >
<DIV id=con>
<UL id=tags>
<LI class=selectTag><A onClick="selectTag('tagContent4',this)"
href="javascript:void(0)"> 饮食科学 </A> </LI>
<LI><A onClick="selectTag('tagContent5',this)"
href="javascript:void(0)"> 烹饪技巧 </A> </LI>
<LI><A onClick="selectTag('tagContent6',this)"
href="javascript:void(0)"> 食品保健 </A></LI>
<LI><A onClick="selectTag('tagContent7',this)"
href="javascript:void(0)"> 季节美食 </A></LI>
</UL>
<DIV id=tagContent >
<DIV class="tagContent selectTag" id=tagContent4><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更>> </div></td></tr>
</table></DIV>
<DIV class=tagContent id=tagContent5><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更多>> </div></td></tr>
</table></DIV>
<DIV class=tagContent id=tagContent6><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更多>> </div></td></tr>
</table></DIV>
<DIV class=tagContent id=tagContent7><table border="0" width="400">
<tr><td> </td>
<td><div align="right">更多>> </div></td></tr>
</table></DIV>
</DIV>
</DIV>
<SCRIPT type=text/javascript>
function selectTag(showContent,selfObj){
var tag = document.getElementById("tags").getElementsByTagName("li");
var taglength = tag.length;
for(i=0; i<taglength; i++){
tag[i].className = "";
}
selfObj.parentNode.className = "selectTag";
for(i=4; j=document.getElementById("tagContent"+i); i++){
j.style.display = "none";
}
document.getElementById(showContent).style.display = "block";
}
</SCRIPT>
</BODY>
</HTML>
ej2.asp
上面的两个文件单独运行是都正常 但在同一个页面的是就出问题了
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
请问是javascript里面要改什么嘛?麻烦大侠帮帮瞅瞅...
[
本帖最后由 kevinxu0638 于 2010-11-26 17:41 编辑 ]