菜鸟求救:挂于链接

crazyahead 2003-08-15 08:53:14
代码如下:
<TABLE border=0 borderColor=#99ffcc cellPadding=0 cellSpacing=0 height=34 id=AutoNumber38 style="BORDER-COLLAPSE: collapse" width=250>
<TBODY><TR>
<TD bgColor=#ffffff height=17 width=38>
<div align=center><span lang=en-gb><font color=#00006a><b>
<% Response.Write ("<a href=newpop1.asp><font color=#000066>记录编号</font></a>") %>
</FONT></SPAN></DIV></TD>
<TD bgColor=#ffffff height=17 width=94><span lang=en-gb><font color=#00006a>
<% Response.Write ("<a href=newpop1.asp><font color=#000066>详细地址</font></a>") %>
</FONT></SPAN></TD>
<TD bgColor=#ffffff height=17 width=57><span lang=en-gb><font color=#00006a>
<% Response.Write ("<a href=newpop1.asp><font color=#000066>面积</font></a>") %>
</FONT><font color=#000000>
<% Response.Write ("<font color=#000066>M²</font> ") %>
</FONT></SPAN></TD>
<TD bgColor=#ffffff height=17 width=66><span lang=en-gb><font color=#00006a>
<% Response.Write ("<a href=newpop1.asp><font color=#000066>价格</font></a>") %>
</FONT><font color=#000000>
<% Response.Write ("<font color=#000066>(万元)</font> ") %>
</FONT></SPAN></TD>
<TD bgColor=#ffffff height=17 width=29>
<div align=center><font color=#00006a face=宋体 style="FONT-SIZE: 9pt">
</FONT></DIV></TD></TR>
</table>

这是通过表格控制在table内显示一行信息,要实现的功能是鼠标移到这一行任何一列位置上时,这一行所有内容颜色改变,整行文字下面出现一条连续的横线,链接到同一位置。
急需,在上面代码的基础上把所需代码完整添入,可直接考去使用的得60分!!
...全文
69 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
crazyahead 2003-08-15
  • 打赏
  • 举报
回复
上面太乱了,是这样的:
<script language="JavaScript">
function mOver(element){
element.parentElement.style.textDecoration='underline';
element.parentElement.style.color='red';
element.parentElement.style.cursor='hand';
}
function mOut(element){
element.parentElement.style.textDecoration='';
element.parentElement.style.color='';
element.parentElement.style.cursor='';
}
</script>

<%for i=1 to 8 %>
<TR><TD bgColor=#ffffff height=17 width=38 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');">
<div align=center>
<% Response.Write (""&rs0("denglubianhao")&"") %>
</DIV></TD>
<TD bgColor=#ffffff height=17 width=94 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');" >
<% Response.Write (""&left( rs("fangwuweizhi"),6) &"") %>
</TD>
<TD bgColor=#ffffff height=17 width=57 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');">
<% Response.Write (""&left( rs3("mianji2"),5) &"") %>

<% Response.Write ("M² ") %>
</TD>
<TD bgColor=#ffffff height=17 width=66 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');">
<% Response.Write (""&rs2("jiage")&" ") %>

<% Response.Write ("万元 ") %>
</TD>
<TD bgColor=#ffffff height=17 width=29 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');"><div align=center>
<%
rs0.movenext
rs.movenext
rs3.movenext
rs2.movenext
rs1.movenext
next
%>
crazyahead 2003-08-15
  • 打赏
  • 举报
回复
改成这样了,还是不能变色<%for i=1 to 8 %>
<script language="JavaScript">
function mOver(element){
element.parentElement.style.textDecoration='underline';
element.parentElement.style.color='red';
element.parentElement.style.cursor='hand';
}
function mOut(element){
element.parentElement.style.textDecoration='';
element.parentElement.style.color='';
element.parentElement.style.cursor='';
}
</script>
<TR><TD bgColor=#ffffff height=17 width=38 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');">
<div align=center>
<% Response.Write (""&rs0("denglubianhao")&"") %>
</DIV></TD>
<TD bgColor=#ffffff height=17 width=94 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');" >
<% Response.Write (""&left( rs("fangwuweizhi"),6) &"") %>
</TD>
<TD bgColor=#ffffff height=17 width=57 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');">
<% Response.Write (""&left( rs3("mianji2"),5) &"") %>

<% Response.Write ("M² ") %>
</TD>
<TD bgColor=#ffffff height=17 width=66 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');">
<% Response.Write (""&rs2("jiage")&" ") %>

<% Response.Write ("万元 ") %>
</TD>
<TD bgColor=#ffffff height=17 width=29 onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open('newpop1.asp?id=<%=rs("denglubianhao")%>');"><div align=center>
<%'fs=rs1("jiaoyifangshi")
'if fs="房屋出租" or fs="房屋求租" then
'Response.Write ("<a href=newpop2.asp?id="&rs("denglubianhao")&"><font color=#FF0000>详情</font></a>")
' else
' Response.Write ("<a href=newpop2.asp?id="&rs("denglubianhao")&"><font color=#000066>详情</font></a>")
' end if
rs0.movenext
rs.movenext
rs3.movenext
rs2.movenext
rs1.movenext
next
%>
jzsh2000 2003-08-15
  • 打赏
  • 举报
回复
你最好是去掉<td></td>之间的任何无用的东西,比如font、a链接等,这些都可以在TD里面定义的,这样就会实现你需要的效果了
jww330 2003-08-15
  • 打赏
  • 举报
回复
楼主写的每一行字最内层都用<font></font>标签,其它的程序,css的优先级都比这个低,没法显示改变颜色效果的,你最好把<font></font>标签都去掉再用css定义试试看。
看看是不是这效果:
<style>
a:link { text-decoration: none; color: #FF6C00}
a:visited { text-decoration: none; color: #FF6C00}
a:active { text-decoration: underline; color: #FF6C00}
a:hover { color: #FFcc00; text-decoration: underline}
</style>
<TABLE border=0 borderColor=#99ffcc cellPadding=0 cellSpacing=0 height=34 id=AutoNumber38 style="BORDER-COLLAPSE: collapse" width=250>
<TBODY><TR>
<TD bgColor=#ffffff height=17 width=38>
<div align=center><b>
<% Response.Write ("<a href=newpop1.asp>记录编号</a>") %>
</DIV></TD>
<TD bgColor=#ffffff height=17 width=94><% Response.Write ("<a href=newpop1.asp>详细地址</a>") %>
</TD>
<TD bgColor=#ffffff height=17 width=57><% Response.Write ("<a href=newpop1.asp>面积</a>") %>

<% Response.Write ("M² ") %>
</TD>
<TD bgColor=#ffffff height=17 width=66><% Response.Write ("<a href=newpop1.asp>价格</a>") %>

<% Response.Write ("(万元) ") %>
</TD>
<TD bgColor=#ffffff height=17 width=29>
</TD></TR>
</table>

有一点我不太明白的,你在整个代码里根本没用到什么变量,数据库或其它功能,你为什么要用asp写得这么麻烦呢?(完全可以用html写嘛。)
crazyahead 2003-08-15
  • 打赏
  • 举报
回复
怎么做阿??
偶真的是菜鸟阿!而且很急!
jww330 2003-08-15
  • 打赏
  • 举报
回复
不懂什么意思,直接用css作个定义不行吗?
crazyahead 2003-08-15
  • 打赏
  • 举报
回复
试了,横线可以出现了,但是还不能变色
不知道为什么。我在body开始就设了<style> a:hover {color:FF0000}</style>
但各个table内的内容还是不能变色,不知道怎么回事

用了你的方法也不能变色,是不是要设table的一些属性阿?
jzsh2000 2003-08-15
  • 打赏
  • 举报
回复
给你写个简单的例子参考一下,希望对你有帮助,方法未必是最好的,但是基本能实现你的要求:
-----------------------------------
<table width="75%" border="1">
<tr>
<td onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open();">adsffasdfsdfsdf</td>
<td onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="window.open();">adsffasdfsdfsdf</td>
</tr>
</table>
<script language="JavaScript">
function mOver(element){
element.parentElement.style.textDecoration='underline';
element.parentElement.style.color='red';
element.parentElement.style.cursor='hand';
}
function mOut(element){
element.parentElement.style.textDecoration='';
element.parentElement.style.color='';
element.parentElement.style.cursor='';
}
</script>
crazyahead 2003-08-15
  • 打赏
  • 举报
回复
哪位热心大哥帮忙,100分拿去!
crazyahead 2003-08-15
  • 打赏
  • 举报
回复
加到120!

61,115

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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