注册 登录
编程论坛 WEB前端(UI)

怎么能让鼠标指向时超链接的文字变为其它色???

ozzie 发布于 2006-01-10 12:28, 2027 次点击

我想在网页上做这样一个效果,

就是当用鼠指向一个有超链接的文字的时候文字就变成其它的色彩.这个功能能实现吗?

有知道的告诉我一下好吗? 先在此谢过了.

10 回复
#2
bestlife2006-01-10 15:38
[CODE]
<div align="center" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'" onclick="this.style.color='green'">鼠标选中时为红色,移开时为蓝色,单击时为绿色</div>
[/CODE]

[此贴子已经被作者于2006-1-10 15:38:54编辑过]

#3
ozzie2006-01-11 19:17
谢谢版主。
#4
ozzie2006-01-11 19:31
<%set rs=server.createobject("adodb.recordset")
sql="select * from SMT_ypxxtwo where SMT_ypxxone_id="&id&" order by SMT_date desc"
rs.open sql,conn,1,1%>
<tr>
<%n=0
do while not rs.eof
n=n+1
set rs1=server.createobject("adodb.recordset")
sql1="select * from SMT_yp where SMT_ypxxtwo_id="&rs("SMT_ypxxtwo_id")&" and SMT_key<>0 and SMT_key<>2 and SMT_key1=1"
rs1.open sql1,conn,1,1
twocount=rs1.recordcount
rs1.close%>
<tr>
<td height=25>
&nbsp; <a href=yp_list.asp?id=<%=rs("SMT_ypxxtwo_id")%>><%=rs("SMT_ypxxtwo")%></a>&nbsp;<font color=red>(<%=twocount%>)</font></td>
</tr>
<tr>
<td background="img/list_line_1.gif"></td>
</tr>
<%rs.movenext
loop
rs.close%>
这是我要加色彩的代码红色的是显示的内容,我想让鼠标指向这些内容时显示为其它色彩,我不知道怎么把上面版主所说的代码加上,试了几次没有成功,请再请高手赐教一下。
谢谢。
#5
bestlife2006-01-12 09:07

你是不是要使<%=rs("SMT_ypxxtwo")%>和<%=twocount%>同步变化?要同步的话要<a href="">里也要加JS,且用了font就不能同步。

<%set rs=server.createobject("adodb.recordset")
sql="select * from SMT_ypxxtwo where SMT_ypxxone_id="&id&" order by SMT_date desc"
rs.open sql,conn,1,1%>
<tr>
<%n=0
do while not rs.eof
n=n+1
set rs1=server.createobject("adodb.recordset")
sql1="select * from SMT_yp where SMT_ypxxtwo_id="&rs("SMT_ypxxtwo_id")&" and SMT_key<>0 and SMT_key<>2 and SMT_key1=1"
rs1.open sql1,conn,1,1
twocount=rs1.recordcount
rs1.close%>
<tr>
<td height=25><div align="center" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'" onclick="this.style.color='green'">
&nbsp; <a href=yp_list.asp?id=<%=rs("SMT_ypxxtwo_id")%> onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'"><%=rs("SMT_ypxxtwo")%></a>&nbsp;<%=twocount%></div></td>
</tr>
<tr>
<td background="img/list_line_1.gif"></td>
</tr>
<%rs.movenext
loop
rs.close%>



#6
泰乐2006-01-12 10:41
用dreamweaver页面属性改下超链接的属性就ok了
想改什么颜色都可以
#7
泰乐2006-01-12 10:50
请教bestlife怎么弄2楼那个程序框,能运行代码的
学习,学习,再学习!!
运行程序

[此贴子已经被作者于2006-1-12 10:53:33编辑过]

#8
泰乐2006-01-12 10:55
自己研究会了 嘎嘎~~~
好高兴
#9
bagger2006-01-20 22:07
这种很普遍的问题还是些个CSS文件比较好,这样就不用每个都这么加了啊!
只要引用这个CSS就好了啊!
#10
孤漠沉风2006-09-15 09:26
&lt;p  style=a:hover:back-ground:red&gt;看看颜色变没&lt;/p&gt;
#11
zmetero112006-09-20 21:50
我晕哟,
这种问题也那出来问啊
1