jquery如何給鼠標進入事件設置三秒后執(zhí)行里面的函數(shù),謝謝

科技 未結 1 895
檬檬細語
檬檬細語 2023-06-16 22:35

<!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 #ffffd; }

</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條回答
  •  人在左岸誰來渡
    2023-06-16 23:24

    settimeout(functoin(){},3000)

    0 討論(0)
提交回復