Home >Web Front-end >JS Tutorial >A very simple way to achieve the highlighting effect of TD._Form special effects

A very simple way to achieve the highlighting effect of TD._Form special effects

WBOY
WBOYOriginal
2016-05-16 19:26:261364browse

Copy code The code is as follows:
function Menu_Init(obj){
var tds = obj.getElementsByTagName ("td");
for (var i = 0; i < tds.length; i )
{
if (tds[i].className == "MenuOptions")
{
tds[i].onmouseover = switch_bg;
tds[i].onmouseout = switch_bg; 🎜>function switch_bg(e){
if (this.className=="MenuOptions_click") return
this.className = (this.className == "MenuOptions") ? "MenuOptions_hilite" : "MenuOptions";
}


Menu_Init(obj) is used to initialize Table.

Required CSS


Copy code
The code is as follows: .MenuOptions{ padding:2px; cursor:hand; color:#000000;
}
.MenuOptions_hilite{
padding:1px ;
border:outset 1px #669999;
cursor:hand;
color:#000000;
}


table demonstration



Copy code



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn