图片名称 sprite.zip <!doctype html>
<html>
<head>
</head>
<style>
.css{
position: absolute;
top: ;
left: ;
height: %;
width: %;
z-index: -;
background-position: center ;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
zoom: ;
background-image: url("117.jpg");
} #video1{
display:none;
}
#play{
width: 60px;
height: 61px;
background:url(sprite.png) no-repeat;
background-position: -60px 0px;
border:none;
} #vid{
width: 60px;
height: 61px;
background:url(sprite.png) no-repeat;
background-position: ;
border:none;
}
.hide{
display:none;
}
</style> <body>
<div class="css">
</div>
<audio src="1.mp3" controls="controls" id="video1">
不支持
</audio> <button type="button" id="play" onclick="playVid()"></button>
<button class="hide" type="button" id="vid" onclick="pauseVid()"></button>
</body> <script>
var myVideo=document.getElementById("video1");
var Oplay = document.getElementById('play');
var Ovid = document.getElementById('vid');
Oplay.onclick=function(){
this.style.display='none';
Ovid.style.display='block';
myVideo.play();
}
Ovid.onclick=function(){
this.style.display='none';
Oplay.style.display='block';
myVideo.pause();
} /** function playVid()
{
myVideo.play();
} function pauseVid()
{
myVideo.pause();
} */
</script>
</html>