网页中当鼠标经过时,字体变色的代码?
来源:百度知道 编辑:UC知道 时间:2024/09/27 06:12:39
onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''
随便套用:
<tr onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''>
或
<td onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''>
<a onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''>xxxxxxx</a>
将Timer的Interval属性设为1000
Private Sub Timer1_Timer()
对象名.ForeColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256)
End Sub
要想单击改变字体颜色,再加两个事件代码。
在窗体上放一个标签,两个按钮,一个计时器,用下面的代码。
Private Sub command1_click()
Timer1.Enabled = True
End Sub
Private Sub command2_click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Command1.Caption = "变色"
Command2.Caption = "停止"