ele.fadeOut (). Queue (); will affect subsequent fadeIn () operations on ele. The
code is as follows:
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.container{
width: 90%;
height: auto;
}
-sharpfadeDiv{
width: 20vw;
height: 20vh;
background: cadetblue;
}
.button{
width: 5vw;
height: 5vw;
border-radius: 50%;
background: deepskyblue;
}
</style>
<script src="../jquery-3.1.1.min.js"></script>
</head>
<body>
<div class="container">
<div id="button0" class="button">button0</div>
<div id="button1" class="button">button1</div>
<div id="fadeDiv"></div>
</div>
<script>
(function () {
$("-sharpbutton0").click(function () {
$("-sharpfadeDiv").fadeOut(1000).queue(function () {
console.log("1");
});
})
$("-sharpbutton1").click(function () {
$("-sharpfadeDiv").fadeIn();
})
})()
</script>
</body>
it is feasible to use setTimeOut () instead of queue (), at present.
however, I would like to ask what is the reason for the consequences of the use of queue () in this way. Thank you for your hard work.