这是我的代码段
$(function() {
$(".red-box").fadeOut(2000); //1
$(".green-box").fadeOut(2000); //2
$(".red-box").fadeIn(2000);//3
});
index.html如下所示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/script.js"></script>
<link rel="stylesheet" href="css/style.css">
<title>TProject Structure</title>
</head>
<body>
<div id="content">
<h1>Project Structure</h1>
<div class="red-box">Red</div>
<div class="green-box">Green</div>
<div class="blue-box">Blue</div>
<div class="clear"></div>
<h2>Hi, I'm the Base Project!</h2>
<p>Add elements here as you like to try out jQuery. This is your playground to test out anything that comes into your mind.</p>
<p><strong>OR:</strong> Copy this project structure into a new directory first to create separate playgrounds for animations, manipulations, event handlers etc.</p>
</div>
</body>
</html>
当我打开HTML页面时,我注意到了
a)首先,红色和绿色框一起淡出。 b)然后红框消失。
我的Qs
a)jQuery如何知道第1行和第2行将一起执行,然后是第3行?
如果执行是&#34;逐行&#34;然后jQuery应该执行第1行(即在淡出之前等待2秒),然后才应该执行第2行等等......
有人可以解释为什么line1和line2的执行会被jQuery联合起来吗?
答案 0 :(得分:0)