html head title Untitled title script language JavaScript var Flag fal

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
var Flag = false;
var TimeOut;
function myf_out() {
TimeOut = setTimeout("myblock1.style.display='none';", 300);
Flag = true;
}
function myf_on() {
if(Flag==true)
{
clearTimeout(TimeOut);
}
Flag = false;
}
</script>
</head>
<body>
<div id="myblock1" name="myblock1" onMouseOut="myf_out();" onMouseOver="myf_on()" style="width:40%;float:left;margin-right:1em;">
<table width="100%" cellspacing="0" cellpadding="0" style="background:#ccc" id="table1" name="table1" border=1>
<tr ><td>1</td><td>2</td></tr>
<tr><td colspan="2" align="center"><br>Хорошая табличка<br></td></tr>
</table>
</div>
<div style="width:40%;float:right;">
<table width="100%" cellspacing="0" cellpadding="0" style="background:#ada" onMouseOut="this.style.visibility='hidden'" border=1>
<tr ><td>1</td><td>2</td></tr>
<tr><td colspan="2" align="center"><br>Плохая табличка, исчезает когда не надо<br></td></tr>
</table>
</div>
<br clear="all">
<a href="#" onClick="window.location.reload()">Обновить</a>
</body>
</html>