jquery, how to run a function as soon as another function ends

前端 未结 6 1832
梦谈多话
梦谈多话 2021-01-12 18:58

*Note: Re-writing question:

I am trying to write the following outside of the individual function calls:

example:

function f1(){
         


        
6条回答
  •  余生分开走
    2021-01-12 19:13

    you can use the jquery Callbacks function, from v1.7up

    var callbacks = $.Callbacks();
    callbacks.add( firstFunction );
    callbacks.add( secondFunction );
    callbacks.fire( );
    

提交回复
热议问题