1.video 标签
src:路径
height :高
width :宽
autoplay: 视频加载完毕自动播放
controls :controls 提供播放暂定等操作按钮
<video src="audio/shake.wav" height="1000px;" width="1000px;" autoplay="autoplay" controls="controls"></video>
2.audio 标签
同上
<audio src="audio/friendship.mp3" autoplay="autoplay" controls="controls"></audio>
3.canvas
<canvas id="c1" onmousemove="asm(event)" onmouseout="ost()"></canvas>
3.1绘制规则长方形
var cc1=document.getElementById("c1"); var c2d=cc1.getContext("2d"); //获取绘图对象 c2d.fillStyle="#0000FF"; //填充的样式 c2d.strokeStyle//边框样式 c2d.fillRect(100,10,150,175); //起点x,y宽高 -边框 c2d.strokeRect(100,10,150,175); //起点x,y宽高 -填充模式 function asm(e){ var x=e.clientX; //获取X的值 var y=e.clientY; //获取Y的值 document.getElementById("show").innerHTML="X:"+x+"-y:"+y; } function ost(){ document.getElementById("show").innerHTML=""; }
3.2绘制三角形
<canvas id="ca1"></canvas> var can1=document.getElementById("ca1").getContext("2d"); can1.moveTo(10,10); can1.lineTo(150,50); can1.lineTo(10,50); can1.fill(); //填充 can1.stroke(); //绘制边界