jquery提示sucess
这是学习笔记。
今天做东西的时候,想把体验做好,于是打算再ajax success字段中添加函数实现提示sucess。
用了jquery的fadeIn 跟fadeOut,再fadeIn的callback函数中调用了fadeOut,所以在#div1显示完后又淡出了。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jquery提示</title>
<link rel="stylesheet" type="text/css" href="bootstrap.css">
<script type="text/javascript" src="jquery-1.8.1.min.js"></script>
</head>
<body>
<button>点我</button>
<div id="div1" style="position: absolute;left: 40%;color:green;display: none;z-index: 99999">
<h1>SUCCESS</h1></div>
</body>
<script>
$(document).ready(function() {
$("button").click(function() {
$("#div1").fadeIn("slow", function() {
$("#div1").fadeOut("slow");
});
});
});
</script>
</html>
浙公网安备 33010602011771号