<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jQuery</title> <script src="jquery-3.3.1.min.js"></script> </head> <body> <script type="text/javascript"> $(function(){ // 按钮单击时执行 $("#btnInfo1").click(function(){ $("#div1").hide("slow",function(){ alert("图层现在被隐藏了"); }); }); }) </script> <div id="div1" style="width:60px;height:60px;background-color:red;"></div><br> <button id="btnInfo1" type="button">callback</button> </body> </html>