<!DOCTYPE html><html> <head> <title>复仇者联盟</title> <meta charset="utf-8" /> <style type="text/css"> *,body{ padding:0; margin:0; } .main{ width:600px; height:400px; background-image:url("res/htmlclassics/full/images/page2_bg.png"); background-position:center; background-repeat:no-repeat; } .view_div{ width:500px; margin:0 auto; position:relative; background-size:cover; } #vo{ width:500px; height:400px; background-color:black; } #controls{ width:500px; height:50px; position:absolute; left:0px; bottom:5px; background-color:rgba(0,0,0,0.5); display:none; justify-content:space-between; } .left{ display:flex; flex-direction:row; justify-content:space-around; align-items:center; width:300px; } .left img{ width:30px; height:30px; } #txt{ width:60px; margin-right:-70px; } .btn{ width:40px; } input{ height:30px; line-height:30px; border-radius:8px; } .right{ width:200px; display:flex; flex-direction:row; justify-content:space-around; align-items:center; } .view_div:hover #controls{ display:flex; } </style> <script> var isPlay = true; function bofang(){ var vo = document.getElementById("vo"); if(isPlay){ vo.play(); document.getElementById("playBtn").src="res/htmlLX/zanting.png"; isPlay = false; }else{ vo.pause(); document.getElementById("playBtn").src="res/htmlLX/bofang.png"; isPlay = true; } } function getTime(){ vo.currentTime = document.getElementById("time").value; } function back(){ vo.currentTime -= 10; } function forward(){ vo.currentTime += 10; } </script> </head> <body> <div class="main"> <!--视频--> <div class="view_div"> <!--视频--> <video id="vo" src="res/htmlclassics/full/video/avenger.mp4" poster="res/htmlclassics/full/images/video_bg.png"> </video> <!--控制按扭--> <div id="controls"> <!--左侧按扭--> <div class="left"> <img id="playBtn" src="http://www.yyfun001.com/res/htmlLX/bofang.png" onclick="bofang()" /> <input id="time" type="text"/> <input class="btn" type="button" value="跳转" onclick="getTime()" /> </div> <!--右侧按扭--> <div class="right"> <input type="button" value="倒退 10 秒" onclick="back()" /> <input type="button" value="快进 10 秒" onclick="forward()" /> </div> </div> </div> </div> </body></html>

