H5 知识点
来源:互联网 发布:可以打鼓的软件 编辑:程序博客网 时间:2024/05/21 18:42
H5新特性video和audio标签
<!DOCTYPE html> <html> <body> <div style="text-align:center;"> <button onclick="playPause()">播放/暂停</button> <button onclick="makeBig()">大</button> <button onclick="makeNormal()">中</button> <button onclick="makeSmall()">小</button> <br /> <video id="video1" width="420" style="margin-top:15px;"> <source src="/example/html5/mov_bbb.mp4" type="video/mp4" /> <source src="/example/html5/mov_bbb.ogg" type="video/ogg" /> Your browser does not support HTML5 video. </video></div> <script type="text/javascript">var myVideo=document.getElementById("video1");function playPause(){ if (myVideo.paused) myVideo.play(); else myVideo.pause(); } function makeBig(){ myVideo.width=560; } function makeSmall(){ myVideo.width=320; } function makeNormal(){ myVideo.width=420; } </script> </body> </html>
在head中调用script
<html><head><script type="text/javascript">function message(){ alert("该提示框是通过 onload 事件调用的。")}</script></head><body onload="message()"></body></html>
在body中调用script
<html><head></head><body><script type="text/javascript">document.write("该消息在页面加载时输出。")</script></body></html>
调用外部脚本
<html><head></head><body><script src="/js/example_externaljs.js"></script><p>实际的脚本位于名为 "xxx.js" 的外部脚本中。</p></body>
自定义事件
<!DOCTYPE html><html><head><script>function myFunction(){document.getElementById("demo").innerHTML="My First JavaScript Function";}function myFunction2(){ document.getElementById("head1").innerHTML="自定义函数";}</script></head><body><h1 id="head1">My Web Page</h1><p id="demo">A Paragraph.</p><button type="button" onclick="myFunction()">点击这里</button><button type="button" onclick="myFunction2()">点我</button></body></html>
0 0
- H5知识点
- H5 知识点
- H5知识点
- h5知识点总结
- H5的小知识点
- h5知识点小测试
- H5零碎知识点整理
- H5最基础知识点
- 第二十二天H5进阶(H5知识点开始)
- H5移动端知识点总结
- H5移动端知识点总结
- H5移动端知识点总结
- H5移动端知识点总结
- H5移动端知识点总结
- H5 Canvas相关小知识点!
- H5移动端知识点总结
- H5移动端知识点总结
- H5移动端知识点总结
- 从零到日志采集索引可视化、监控报警、rpc trace跟踪-自定义日志框架
- 【Java】关于ajax的session过期跳转登录
- AR 开发资料汇总
- 类似Build Error: #513: a value of type "int" cannot be assigned to an entity of type "char *"
- 用composer在laravel框架下安装极光时遇到的问题
- H5 知识点
- 清除webBrowser 缓存和Cookie的解决方案
- 线索二叉树(中序) Java实现
- JS处理各种JSON类型数据
- 使用Atmel Studio编程Arduino Uno开发板
- 欢迎使用CSDN-markdown编辑器
- 如何用MindManager辅助5W2H分析法
- safari浏览器实现模拟click点击事件
- 关于百度地图设置显示的比例尺大小