您的位置:首页 > Web前端 > HTML

html 的基础知识

2014-09-04 09:44 260 查看
仅供自己学习参考之用~

1.视频播放(包括html自带的 和 javascript自己实现的)

<script type="text/javascript">

    function vidplay() {

       var video = document.getElementById("Video1");

       var button = document.getElementById("play");

       if (video.paused) {

          video.play();

          button.textContent = "||";

       } else {

          video.pause();

          button.textContent = ">";

       }

    }

    function restart() {

        var video = document.getElementById("Video1");

        video.currentTime = 0;

    }

    function skip(value) {

        var video = document.getElementById("Video1");

        video.currentTime += value;

    }      

</script> 

<video id="Video1" width="100%" muted autoplay controls>

     <source src="source/demo.mp4" type="video/mp4" />

</video>

 <div id="buttonbar">

    <button id="restart" onclick="restart();">[]</button> 

    <button id="rew" onclick="skip(-10)"><<</button>

    <button id="play" onclick="vidplay()">></button>

    <button id="fastFwd" onclick="skip(10)">>></button>

</div>     

2.<textarea name="yoursuggest" cols ="50" rows = "50"></textarea>
其中cols表示textarea的宽度,rows表示textarea的高度。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: