Ciao,
puoi fare in tanti modi.
In javaScript si usa solitamente setTimeout e clearTimeout.
Con jQuery potresti usare le funzioni delay e stop.
Un esempio:
codice:
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function() {
$("#subDiv").slideUp(0)
$("#mioDiv").hover(function() {
$("#subDiv").delay(1000).slideDown();// delay è espresso in millisecondi
}, function() {
$("#subDiv").stop(true).slideUp();
});
});
</script>
</head>
<body">
<div id="mioDiv" style="width:300px;background:#ccc;cursor:pointer">resta su di me per aprire subDiv
<div id="subDiv" style="width:300px;background:#ddd">subdiv</div>
</div>
</body>
</html>