方法一:
$("#notice").fadeIn(function() {
setTimeout(function() {
$("#notice").fadeOut();
}, 3000);
});
方法二:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="js/jquery-1.4.2.js"></script>
<script>
function show(){
alert("show!!");
}
$(function(){
$('#mydiv').mouseover(function(){
t = setTimeout("show()",2000);
}).mouseout(function(){
clearTimeout(t);
});
});
</script>
</head>
<body>
<span id="mydiv">我是菜单</span>
</body>
$("#notice").fadeIn(function() {
setTimeout(function() {
$("#notice").fadeOut();
}, 3000);
});
方法二:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="js/jquery-1.4.2.js"></script>
<script>
function show(){
alert("show!!");
}
$(function(){
$('#mydiv').mouseover(function(){
t = setTimeout("show()",2000);
}).mouseout(function(){
clearTimeout(t);
});
});
</script>
</head>
<body>
<span id="mydiv">我是菜单</span>
</body>