onclick 延迟的多个功能
onclick multiple functions with delay
我需要这样的东西:
onClick="function1(); function2();"
函数之间有一个小的延迟。
我不想在函数 1 的末尾调用函数 2。
onclick="functionCaller";
<script>
function functionCaller(){
function1();
setTimeout(function2, 500); //this will call function2 after 500 millisecons.
}
</script>
我需要这样的东西:
onClick="function1(); function2();"
函数之间有一个小的延迟。 我不想在函数 1 的末尾调用函数 2。
onclick="functionCaller";
<script>
function functionCaller(){
function1();
setTimeout(function2, 500); //this will call function2 after 500 millisecons.
}
</script>