Hi,
I have the following HTML and Javascript. I just want to show the hidden one at a time only when mouseover a link. If the mouse is over the link "Drink", then show the hidden div below that link only and other hidden div must stay hidden.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Untitled Document
</title>
<script type="text/javascript" src="jquery.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
// timer for hiding the div
var hideTimer;
// show the DIV on mouse over
$(".show_div").mouseover(function() {
// forget any hiding events in timer
clearTimeout( hideTimer );
$(".hello").css('visibility', 'visible');
});
$(".hello").mouseover(function() {
clearTimeout( hideTimer );
$(".hello").css('visibility', 'visible');
});
// set a timer to hide the DIV
$(".show_div").mouseout(function() {
hideTimer = setTimeout( hideHello, 333 );
});
$(".hello").mouseout(function() {
hideTimer = setTimeout( hideHello, 333 );
});
// hides the DIV
function hideHello() {
$(".hello").css('visibility', 'hidden');
}
});
</script>
</head>
<body>
<br/>
<table border="1" width="400">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td><a class="show_div" href="#">Drink</a>
<div class="hello" style="visibility:hidden;z-index:999;position: absolute;background-color:#99CC67;">
<ul>
<li>
Coffee
</li>
<li>
Tea
</li>
<li>
Milk
</li>
</ul>
</div>
</td>
<td><a class="show_div" href="#">Friuts</a>
<div class="hello" style="visibility:hidden;z-index:999;position: absolute;background-color:#99CC67;">
<ul>
<li>
Banana
</li>
<li>
Water Melon
</li>
<li>
Lychee
</li>
</ul>
</div>
</td>
</tr>
<tr>
<td><a class="show_div" href="#">Movies</a>
<div class="hello" style="visibility:hidden;z-index:999;position: absolute;background-color:#99CC67;">
<ul>
<li>
Avatar
</li>
<li>
Star War
</li>
<li>
Titanic
</li>
</ul>
</div>
</td>
<td><a class="show_div" href="#">Books</a>
<div class="hello" style="visibility:hidden;z-index:999;position: absolute;background-color:#99CC67;">
<ul>
<li>
Novel
</li>
<li>
History
</li>
<li>
Design
</li>
</ul>
</div>
</td>
</tr>
</table>
<br/>
</body>
</html>
Can anyone help me fix this? Thank you.