How do I chain or queue custom functions using JQuery?

前端 未结 15 1410
暗喜
暗喜 2020-12-04 19:49

I have multiple functions the do different animations to different parts of the HTML. I would like to chain or queue these functions so they will run the animations sequenti

15条回答
  •  渐次进展
    2020-12-04 20:37

    I'd create an array of functions and add every function you want to queue to it.

    Then I'd append a function call which loops through the array and calls each function to the event through jQuery.

    You could probably create a very simple plugin for jQuery that could handle this internally as well.

提交回复
热议问题