VBScript 我想 javascript 也一样
<Script Language=vbs>
Sub TextLinkOver
Dim oSource
Set oSource = window.event.srcElement 得到当前对象
oSource.style.color = "yellow" Rem 字体颜色 oSource.style.textDecorationUnderline = true Rem 下划线
oSource.style.cursor = "hand" Rem 鼠标类型,手型
End Sub
</Script>
<a onmouseover="vbs:TextLinkOver">Test</a>
<Script Language=vbs>
Sub TextLinkOver
Dim oSource
Set oSource = window.event.srcElement 得到当前对象
oSource.style.color = "yellow" Rem 字体颜色 oSource.style.textDecorationUnderline = true Rem 下划线
oSource.style.cursor = "hand" Rem 鼠标类型,手型
End Sub
</Script>
<a onmouseover="vbs:TextLinkOver">Test</a>
a:link { color: blue; }
a:active { color: yellow; }
a:link { color: blue; }
a:hover { color: yellow; }
<a href="." onmouseover="this.style.color='red'" onmouseout="this.style.color='green'">AAA</a>
a:active { color: yellow; }
顺便问一下:
用javascript如何实现对某一个table中的tr下的td的背景色属性进行动态修改;该如何写代码?
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="_On_Over()" />
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="_On_Out()" />
<SCRIPT>
var _color=element.currentStyle.color;
var _bgcolor=element.currentStyle.backgroundColor;
function _On_Over()
{
runtimeStyle.color="black";
runtimeStyle.backgroundColor="#F3F3F3";
}
function _On_Out()
{
runtimeStyle.color=_color;
runtimeStyle.backgroundColor=_bgcolor;
}
</SCRIPT>
</PUBLIC:COMPONENT>用法是在Style里面写
.chgBgcolor {behavior:url('btn.htc');}<table> <tr class="chgBgcolor"><td></td></tr></table>