播放 next/prev 按钮问题?

the play next/prev button issue?

当我设置视频的标题时,它会出现几秒钟,然后在每个视频播放后消失。没有 play-next/prev 按钮一切正常。如果我多次快速按下任一按钮,标题会重新出现并似乎永远消失。请检查 the complete code from JSfiddle.

function nextVideo(){
    $('#videotittle').hide();
    play(vidIndex + 1);
}

function prevVideo(){
    $('#videotittle').hide();
    play(vidIndex - 1);
}

您是否尝试将 .stop( true, true ) 添加到您的动画中?

您的 fiddle 已更新:

http://jsfiddle.net/hftgmuLy/

为延迟标题的初始显示而调用的 setTimeout 永远不会取消 (Cleartimeout) 需要保留对可以取消的 setTimeout 的引用,例如:

curTimeout =setTimeout( ....

正在播放:clearTimeout(curTimeout);

Fiddle

PS,fiddle 是基于 previous 答案的评论中较旧的 fiddle。它可能与新版本有些不同