<!DOCTYPE html>
<html lang="zh-Cn">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
font-family: "Microsoft YaHei", serif;
}
body, dl, dd, p, h1, h2, h3, h4, h5, h6 {
margin: 0;
}
ol, ul, li {
margin: 0;
padding: 0;
list-style: none;
}
img {
border: none
}
#wrap{
width: 100px;
height: 100px;
background-color: #cc3366;
}
</style>
</head>
<body>
<div id="wrap"></div>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>
// 如果不加入队列中间的就直接瞬间执行了
// 加入队列之后一定要dequeue不然后边的没法识别你到底执行完没有
// 最后一个也要dequeue 如果后边继续加的话 没办法识别到你是不是结束了
$wrap = $("#wrap");
$wrap.animate({
marginLeft:200
},1000)
.queue(function () {
$(this).html("top完成");
$(this).css("color","red");
// 需要手动dequeue来表示这个队列结束了
$(this).dequeue();
})
.delay(1000)
.animate({
marginTop:200
},1000)
</script>
</body>
</html>
Python3Turtle