0
當HTML5背景視頻到達特定點時,我想要我的動畫。現在一旦視頻結束,它就開始了。有一種方法可以查找視頻的進度,並在視頻達到某個特定點時開始播放動畫?這是我的代碼。在HTML5視頻中啓動JavaScript動畫
// Browser Window Size and Position
function animCD_pageWidth() { return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;}
function animCD_pageHeight() {return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;}
// Add the canvas to the DOM object and kick off our animation sequnce
function animCD_start()
{
if (animCD_loaded) return;
// - Add them to the document (done here since it needs to be done after the DOM object is loaded
document.body.appendChild(animCD_cBack);
document.body.appendChild(animCD_cDisk);
document.body.appendChild(animCD_cMidd);
document.body.appendChild(animCD_cFore);
document.body.appendChild(animCD_cBuff);
document.body.appendChild(animCD_cBuf2);
animCD_loaded = true;
// - Start animating
animCD_Loop();
}