正在加载图片...
Wdb前端开发》实验教学指导/实验四:在网页中使用表单和多媒体10 function update Progresso value=Math. round( ( Math. floor(video. current Time )/Math. floor(video. duration))*100, 0) progress=document. getElement Byld(play Percent,) progress. value= value var progressvalue=document. getElementByld(progressvalue") progressvalue style width= value+% show Time. innerHTML-calcT ime(Math. floor(video. current Time))+/+calcT ime(Math. floor (video duration) function calcTime(time var hour: var minute var second. hour=String(parseInt(time/3600, 10)) if (hour length== 1) hour =0+ hour minute=String(parseInt(time%3600)/60, 10)) if (minute length == 1) minute =0+ minute second=String(parseInt(time%60, 10) if (second length==1) second =0+ second return hour +". "+minute+" +second function progress_mouseover(ev) show Time. innerHTML-caIcT ime( Math. floor(video currentT ime)+/+calcTime (Math. floor (video duration)) stop Propagation function progress_ mouseout(ev show Time. innerHTML=". play Percent=document getElement Byld( play Percent video currentTime= video duration"(evt. offsetX play Percent. clientWidth): function progress_click(evt progress=document. getElement Byld("progress"): video currentTime= video duration*(evt. offsetX /progress. clientWidth) 河南中医学院互联网应用技术研究 本讲共计12页|当前第10页《Web 前端开发》实验教学指导 / 实验四:在网页中使用表单和多媒体 河南中医学院互联网应用技术研究所 本讲共计 12 页 | 当前第 10 页 function updateProgress() { var value=Math.round((Math.floor(video.currentTime)/Math.floor(video.duration))*100,0); var progress = document.getElementById('playPercent'); progress.value = value; var progressValue=document.getElementById("progressValue"); progressValue.style.width = value+"%"; showTime.innerHTML=calcTime(Math.floor(video.currentTime))+'/'+calcTime(Math.floor (video.duration)); } function calcTime(time) { var hour; var minute; var second; hour=String(parseInt(time/3600,10)); if (hour.length == 1) hour = '0' + hour; minute=String(parseInt((time%3600)/60,10)); if (minute.length == 1) minute = '0' + minute; second=String(parseInt(time%60,10)); if (second.length == 1) second = '0' + second; return hour+":"+minute+":"+second; } function progress_mouseover(ev) { showTime.innerHTML=calcTime(Math.floor(video.currentTime))+'/'+calcTime(Math.floor (video.duration)); ev.stopPropagation(); } function progress_mouseout(ev) { showTime.innerHTML=""; } function playPercent_click(evt) { if(evt.offsetX) { playPercent=document.getElementById("playPercent"); video.currentTime = video.duration * (evt.offsetX / playPercent.clientWidth); } } function progress_click(evt) { progress=document.getElementById("progress"); if(evt.offsetX) video.currentTime = video.duration * (evt.offsetX /progress.clientWidth);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有