简单的现实问题,请帮忙。。。。 谢谢

freedoom79 2003-09-28 02:47:41
当点击组的设置时,用户设置的那部分没有取消掉,也就是有显示到页面了,怎么修改才能点击时置显示相应的部分。。。。。

<%@ page contentType="text/html; charset=gb2312" %>

<script lauguage="javascript">
function change_prev()
{
window.font_prev.style.fontWeight="bold";
window.font_group.style.fontWeight="";

document.all.prev.style.display='';
document.all.group.style.display='none';

}

function change_group()
{
window.font_prev.style.fontWeight="";
window.font_group.style.fontWeight="bold";


document.all.prev.style.display='none';
document.all.group.style.display='';

}
function change_style(i_d)
{
switch(i_d){
case "prev":change_prev();break;
case "group":change_group();break;

default:break;
}
}
</script>

<table BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% align=right ><tr><td align="right" valign="top" >
<table bgcolor="##99CCFF" cellspacing="0" BORDER=0 CELLPADDING=0 CELLSPACING=0 ><tr>
<td valign="top" height="25" background="../images/whitebackground.gif" valign="center" style="cursor:hand;BORDER-BOTTOM: ##6699FF 1px solid;
BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #000000 1px solid; "
onclick="change_style('prev');" id="button_prev"><font id=font_prev>  用户设置  
</font></td>

<td valign="top" height="25" background="../images/whitebackground.gif" valign="center" style="cursor:hand;BORDER-BOTTOM: #FDDCCC 1px solid;
BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #000000 1px solid; "
onclick="change_style('group');" id="button_group"><font id=font_group>  组的设置  
</font></td>


</table>
</td></tr></table><br>

<table BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% align=left>
<div align=left id="prev" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">aa</a>
</td></tr>
</table>

</div>
<div id="group" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">bb</a>
</td></tr>
</table>
</div>

</table>
...全文
77 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
freedoom79 2003-09-28
  • 打赏
  • 举报
回复
to eva(eva):
能在qq 上聊不?我觉得自己有好多问题,我的QQ :50909681
freedoom79 2003-09-28
  • 打赏
  • 举报
回复
to eva(eva):
明白了, 谢谢

我还有个问题,我这里不是设置了一个连接吗?

我怎样做才能让这个连接联到下一个页面时,上边的按钮(设置1,设置2)还存在,不用框架可以实现吗? 用框架怎么用呢?

eva 2003-09-28
  • 打赏
  • 举报
回复
试试下面这段代码

<%@ page contentType="text/html; charset=gb2312" %>

<script lauguage="javascript">
function change_prev()
{
window.font_prev.style.fontWeight="bold";
window.font_group.style.fontWeight="";

document.all.prev.style.display='';
document.all.group.style.display='none';

}

function change_group()
{
window.font_prev.style.fontWeight="";
window.font_group.style.fontWeight="bold";


document.all.prev.style.display='none';
document.all.group.style.display='';

}
function change_style(i_d)
{
switch(i_d){
case "prev":change_prev();break;
case "group":change_group();break;

default:break;
}
}
</script>

<table BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% align=right ><tr><td align="right" valign="top" >
<table bgcolor="##99CCFF" cellspacing="0" BORDER=0 CELLPADDING=0 CELLSPACING=0 ><tr>
<td valign="top" height="25" background="../images/whitebackground.gif" valign="center" style="cursor:hand;BORDER-BOTTOM: ##6699FF 1px solid;
BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #000000 1px solid; "
onclick="change_style('prev');" id="button_prev"><font id=font_prev>  设置1  
</font></td>

<td valign="top" height="25" background="../images/whitebackground.gif" valign="center" style="cursor:hand;BORDER-BOTTOM: #FDDCCC 1px solid;
BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #000000 1px solid; "
onclick="change_style('group');" id="button_group"><font id=font_group>  设置2  
</font></td>


</table>
</td></tr></table><br>

<table BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% align=left>
<tr><td>
<div align=left id="prev" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">aa</a>
</td></tr>
</table>
</div>
<div id="group" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">bb</a>
</td></tr>
</table>
</div>
</td></tr>
</table>
eva 2003-09-28
  • 打赏
  • 举报
回复
我的意思是说你容纳层的table应该加上<tr><TD>和</td></tr>
你仔细看一下,这个table没有tr td
或者你将这个table去掉,只留两个div及其内部的东西

我是过了,你用我给你的代码替换掉你最后的代码(那个table和层)
注意将我得注释去掉
试一下就明白了
freedoom79 2003-09-28
  • 打赏
  • 举报
回复
to eva(eva):
没变化,试过没?
你那样修改是什么意思? 中间的部分算放在那了 ; 源代码可以直接用ie 浏览的,效果已看就知道了。。。。
<%@ page contentType="text/html; charset=gb2312" %>

<script lauguage="javascript">
function change_prev()
{
window.font_prev.style.fontWeight="bold";
window.font_group.style.fontWeight="";

document.all.prev.style.display='';
document.all.group.style.display='none';

}

function change_group()
{
window.font_prev.style.fontWeight="";
window.font_group.style.fontWeight="bold";


document.all.prev.style.display='none';
document.all.group.style.display='';

}
function change_style(i_d)
{
switch(i_d){
case "prev":change_prev();break;
case "group":change_group();break;

default:break;
}
}
</script>

<table BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% align=right ><tr><td align="right" valign="top" >
<table bgcolor="##99CCFF" cellspacing="0" BORDER=0 CELLPADDING=0 CELLSPACING=0 ><tr>
<td valign="top" height="25" background="../images/whitebackground.gif" valign="center" style="cursor:hand;BORDER-BOTTOM: ##6699FF 1px solid;
BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #000000 1px solid; "
onclick="change_style('prev');" id="button_prev"><font id=font_prev>  设置1  
</font></td>

<td valign="top" height="25" background="../images/whitebackground.gif" valign="center" style="cursor:hand;BORDER-BOTTOM: #FDDCCC 1px solid;
BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #000000 1px solid; "
onclick="change_style('group');" id="button_group"><font id=font_group>  设置2  
</font></td>


</table>
</td></tr></table><br>

<table BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% align=left>
<div align=left id="prev" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">aa</a>
</td></tr>
</table>
</div>
<div id="group" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">bb</a>
</td></tr>
</table>
</div>
</table>
eva 2003-09-28
  • 打赏
  • 举报
回复
请看注释:丢掉的部分,加上<tr><td> </td></tr>就好了
<table BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% align=left>
<tr><td> //丢掉的部分
<div id="group" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">bb</a>
</td></tr>
</table>
</div>
<div align=left id="prev" style="display:none;">
<table>
<tr><td>
<a href="first.jsp">aa</a>
</td></tr>
</table>

</div>
</td></tr> //丢掉的部分
</table>

87,988

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧