🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# jquery 队列queue使用总结 ~~~ var Canvas = function () { this.queue = [] this.init = function () { this.queue.push(this.part1) this.queue.push(this.part2) console.log('sss') $('img').queue('imgArray', this.part1) $('img').queue('imgArray', this.part2) $('img').dequeue('imgArray') } this.part1 = function (next) { $('img').animate({'width': 600}, 'imgArray') next() } this.part2 = function (next) { $('img').animate({'height': 900}, 'imgArray') next() } this.init() } new Canvas() ~~~ ### 队列使用总结 * 定义队列函数,或者队列函数数组 * 使用$(target).queue('name',[]|function)添加队列 * 使用$(target).dequeue('name')弹出队列并且执行