const x = [
20, 40, 60, 80, 100
]
let count = 0
const dom = $('.move')
const moveFun = (left) => {
return new Promise((resolve) => {
dom.animate({ left }, 1000, 'linear', () => {
count++
resolve()
})
})
}
moveFun(100)
.then(() => moveFun(500))
.then(() => moveFun(200))
.then(() => moveFun(100))
.then(() => moveFun(566))
.then(() => moveFun(1000))
.then(() => moveFun(100))
网友评论