stop function that run with setTimeout

前端 未结 3 1455
梦如初夏
梦如初夏 2020-12-07 04:15

I want stop my function that run with setTimeout and do not show image followed mouse. I want do that with button click, how do that? my code:



        
3条回答
  •  孤街浪徒
    2020-12-07 05:10

    you use timeout like >

    var myTimeout = setTimeout(yourfunction);
    

    and then you can cancel it >

    clearTimeout(myTimeout);
    

提交回复
热议问题