下拉菜单 的问题 asp
源代码是这样的:<scriptlanguage="javascript">functiondisplay(Q_subtree,Q_img,root_subtree){if...
源代码是这样的:
<script language="javascript">
function display(Q_subtree,Q_img,root_subtree){
if(Q_subtree.style.display=="none"){
Q_subtree.style.display="";
root_subtree.bgColor ="#ff0000";
root_subtree.style.color ="#FFFFFF";
Q_img.src="tree_collapse.gif";
}
else{
Q_subtree.style.display="none";
root_subtree.bgColor ="";
root_subtree.style.color ="";
Q_img.src="tree_expand.gif";
}
}
</script>
<table width='100%' border=0 cellspacing=0 cellpadding=0>
<tr><td width='100%' id="root_tree331" style="color:'#666666'">
<span class="STYLE2" style='CURSOR:hand;' onclick='display(document.all.tree1331,document.all.img1331,document.all.root_tree331);'><img id=img1331 src='tree_expand.gif' align='absmiddle' ><b>Cadence PCB 基本设计</b></span></td>
</tr>
<tr id=tree1331 style='display:none'><td>
<table cellspacing=0 cellpadding=0 border=0 width='100%'><tr><td width='100%' class="STYLE2" id="root_tree331_344" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro PCB Design HDL-L</a></span></td></tr><tr><td width='100%' id="root_tree331_343" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro Design Entry CIS</a></span></td></tr><tr><td width='100%' id="root_tree331_345" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a >Allegro PCB Performance</a></span></td></tr></table></td>
</tr>
<tr><td width='100%' id="root_tree340" style="color:'#666666'">
<span class="STYLE2" style='CURSOR:hand;' onclick='display(document.all.tree340,document.all.img340,document.all.root_tree340);'><img id=img340 src='tree_expand.gif' align='absmiddle' ><b>Cadence PCB 专业设计</b></span></td>
</tr>
<tr id=tree340 style='display:none'><td>
<table cellspacing=0 cellpadding=0 border=0 width='100%'><tr><td width='100%' class="STYLE2" id="root_tree340_346" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro Design Entry HDL-XL</a></span></td></tr><tr><td width='100%' id="root_tree340_347" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro PCB Design CIS-XL</a></span></td></tr><tr><td width='100%' id="root_tree340_348" style="color:'#666666'"> aa
就是这种效果 展开
<script language="javascript">
function display(Q_subtree,Q_img,root_subtree){
if(Q_subtree.style.display=="none"){
Q_subtree.style.display="";
root_subtree.bgColor ="#ff0000";
root_subtree.style.color ="#FFFFFF";
Q_img.src="tree_collapse.gif";
}
else{
Q_subtree.style.display="none";
root_subtree.bgColor ="";
root_subtree.style.color ="";
Q_img.src="tree_expand.gif";
}
}
</script>
<table width='100%' border=0 cellspacing=0 cellpadding=0>
<tr><td width='100%' id="root_tree331" style="color:'#666666'">
<span class="STYLE2" style='CURSOR:hand;' onclick='display(document.all.tree1331,document.all.img1331,document.all.root_tree331);'><img id=img1331 src='tree_expand.gif' align='absmiddle' ><b>Cadence PCB 基本设计</b></span></td>
</tr>
<tr id=tree1331 style='display:none'><td>
<table cellspacing=0 cellpadding=0 border=0 width='100%'><tr><td width='100%' class="STYLE2" id="root_tree331_344" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro PCB Design HDL-L</a></span></td></tr><tr><td width='100%' id="root_tree331_343" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro Design Entry CIS</a></span></td></tr><tr><td width='100%' id="root_tree331_345" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a >Allegro PCB Performance</a></span></td></tr></table></td>
</tr>
<tr><td width='100%' id="root_tree340" style="color:'#666666'">
<span class="STYLE2" style='CURSOR:hand;' onclick='display(document.all.tree340,document.all.img340,document.all.root_tree340);'><img id=img340 src='tree_expand.gif' align='absmiddle' ><b>Cadence PCB 专业设计</b></span></td>
</tr>
<tr id=tree340 style='display:none'><td>
<table cellspacing=0 cellpadding=0 border=0 width='100%'><tr><td width='100%' class="STYLE2" id="root_tree340_346" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro Design Entry HDL-XL</a></span></td></tr><tr><td width='100%' id="root_tree340_347" style="color:'#666666'"> <span style='CURSOR:hand;'><img src='tree_collapse.gif' align='absmiddle'><a class=no >Allegro PCB Design CIS-XL</a></span></td></tr><tr><td width='100%' id="root_tree340_348" style="color:'#666666'"> aa
就是这种效果 展开
展开全部
你改变图片时的代码写错了。
你的原来是Q_img,但是代码中没有这个ID,而是img1331
所以,我稍稍改了一下。
function display(Q_subtree,Q_img,root_subtree){
if(Q_subtree.style.display=="none"){
Q_subtree.style.display="";
root_subtree.bgColor ="#ff0000";
root_subtree.style.color ="#FFFFFF";
document.getElementById("img1331").src="tree_collapse.gif";
}
else{
Q_subtree.style.display="none";
root_subtree.bgColor ="";
root_subtree.style.color ="";
document.getElementById("img1331").src="tree_expand.gif";
}
}
你的原来是Q_img,但是代码中没有这个ID,而是img1331
所以,我稍稍改了一下。
function display(Q_subtree,Q_img,root_subtree){
if(Q_subtree.style.display=="none"){
Q_subtree.style.display="";
root_subtree.bgColor ="#ff0000";
root_subtree.style.color ="#FFFFFF";
document.getElementById("img1331").src="tree_collapse.gif";
}
else{
Q_subtree.style.display="none";
root_subtree.bgColor ="";
root_subtree.style.color ="";
document.getElementById("img1331").src="tree_expand.gif";
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询