Execute jQuery function after another function completes

前端 未结 4 2074
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 00:30

I want to execute a custom jQuery function after another custom function completes
The first function is used for creating a \"typewriting\" effect

func         


        
4条回答
  •  迷失自我
    2020-11-29 01:02

    You could also use custom events:

    function Typer() {
        // Some stuff
    
        $(anyDomElement).trigger("myCustomEvent");
    }
    
    
    $(anyDomElement).on("myCustomEvent", function() {
        // Some other stuff
    });
    

提交回复
热议问题