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
Release: 2016-05-16 19:26:26
Original
1366 people have browsed it

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



source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template