💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
# 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')弹出队列并且执行