为什么鼠标放上去后闪烁个不停?
我写了个html:
<html>
<head><title>Design Menu</title></head>
<script language="javascript" type="text/javascript">
var flag = 0;
function ChangeView(id){
var node_element = document.getElementById(id);
if(id){
if(flag == 0){
node_element.innerHTML = "<font style='background-color: #80ff00'>Menu Item1</font>" ;
flag = 1;
}
}
}
function Recover(id){
var node_element = document.getElementById(id);
if(id){
if(flag == 1){
// node_element.style.display = "";
node_element.innerHTML = "Menu Item1" ;
flag=0;
}
}
}
function run_app(){
alert("run application...");
}
</script>
<body>
<table border="1px">
<tr>
<th id="id_item1" onmouseover="ChangeView('id_item1');" onmouseout="Recover('id_item1');" onclick="run_app();">Menu Item1</th>
</tr>
<tr>
<th>Menu Item2</th>
</tr>
</table>
</body>
</html>
/------------------------------
想实现,当鼠标放到Menu Item1时将它的背景改为绿色,但是却发现,那个绿色背景闪烁个不停,不知何故?请大家帮看看:)谢谢了。