<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JQuery回调函数</title>
</head>
<body>
<button id="button1">先弹窗后隐藏-原生</button><br>
<button id="button2">先隐藏后弹窗-回调</button>
<p>我们段落内容,点击“隐藏”按钮我就会消失</p>
<br><br>
</body>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#button1").click(function () {
$("p").hide("slow");
alert("段落现在被隐藏了");
});
$("#button2").click(function () {
$("p").hide("slow",function () {
alert("段落现在被隐藏了");
})
});
})
</script>
</html>