jquery如何给鼠标进入事件设置三秒后执行里面的函数,谢谢 财富值3

2016-10-13 11:17发布

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">

    p{         width:150px;         height:150px;         float:left;         border:1px solid #ddd;     }

</style>
</head>
<body>

<div id="append">     <p>amaze</p>     <p>amaze</p>     <p>amaze</p>     <p>amaze</p> </div> <script type="text/javascript" src="jquery-3.1.1.min.js"></script> <script type="text/javascript">     $("#append").on("mouseenter mouseleave","p",function(e){                 if(e.type == "mouseenter"){                     //鼠标进入                     $(this).text("wow");                 }else if(e.type == "mouseleave"){                     //鼠标离开                    $(this).text("amaze");                 }             }); </script>

</body>
</html>

1条回答

settimeout(functoin(){},3000)

一周热门 更多>