<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-1.4a2.min.js"></script>
<style>
.a1 {
height:300px;
width:200px;
background-color:blue;
}
.a2 {
height:300px;
width:200px;
position:absolute;
top:20px;
left:200px;
background-color:blueviolet;
display:none;
}
</style>
</head>
<body>
<div class="a1"></div>
<div class="a2"></div>
<script>
$(".a1").mouseout(function () {
$(".a1").removeClass("hover");
setTimeout(function () {
if (!$(".a2").hasClass("hover"))
{
$(".a2").hide();
}
},500);
})
$(".a1").mouseenter(function () {
$(".a1").addClass("hover");
$(".a2").show();
})
$(".a2").mouseout(function () {
$(".a2").removeClass("hover");
setTimeout(function () {
if (!$(".a1").hasClass("hover")) {
$(".a2").hide();
}
}, 500);
})
$(".a2").mouseenter(function () {
$(".a2").addClass("hover");
$(".a2").show();
})
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-1.4a2.min.js"></script>
<style>
.a1 {
height:300px;
width:200px;
background-color:blue;
}
.a2 {
height:300px;
width:200px;
position:absolute;
top:20px;
left:200px;
background-color:blueviolet;
display:none;
}
</style>
</head>
<body>
<div class="a1"></div>
<div class="a2"></div>
<script>
$(".a1").mouseout(function () {
$(".a1").removeClass("hover");
setTimeout(function () {
if (!$(".a2").hasClass("hover"))
{
$(".a2").hide();
}
},500);
})
$(".a1").mouseenter(function () {
$(".a1").addClass("hover");
$(".a2").show();
})
$(".a2").mouseout(function () {
$(".a2").removeClass("hover");
setTimeout(function () {
if (!$(".a1").hasClass("hover")) {
$(".a2").hide();
}
}, 500);
})
$(".a2").mouseenter(function () {
$(".a2").addClass("hover");
$(".a2").show();
})
</script>
</body>
</html>