我的 javascript 间隔中有 2 个函数:我用 2 个 html 按钮开始间隔,开始(启动它)和停止(停止它)
这是开始的:
function start_sync(){
    //runs the interval
    if(sync_interval == false)
    {
        sync_interval = setInterval(function(){
            gl_context.drawImage(gl_video,0,0,gl_cw,gl_ch);
            update_seek_slider_position(gl_video.currentTime);
        },10);
        sync_interval_running = true;
    };
    console.log("Sync Interval Started");
};
当我按下停止时调用它:
function stop_sync(){
    if(sync_interval == true)
    {
        clearInterval(sync_interval); //stops the interval
        sync_interval_running = false;
    };
    console.log("Sync Interval Stopped");
}
好的,第二个功能不会停止,“update_seek_slider_position(gl_video.currentTime);” 它仍然是一个。
js区间是否只接受一个函数?