<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<script type="text/javascript">
function zd1(){
navigator.vibrate(1000);
}
function zd2(){
navigator.vibrate([3000, 2000, 1000]);
}
</script>
<p>在`window.navigator`对象里就只有一个关于振动的API:`vibrate`。</p>
<h1>基础功能</h1>
<p>`navigator.vibrate`函数可以接受一个数字参数,也可以接受一个数字数组,当使用数组参数时,奇数位的数值是震动秒数,偶数位为等待秒数。</p>
<button onClick="zd1();">点击我振动1秒</button><br/>
<button onClick="zd2();">点击我振动3秒,等2秒,再振动1秒</button><br/>
<p>如果想停止震动,你只需要向`navigator.vibrate`方法里传入`0`,或一个空数组:</p>
</body>
</html> 离线缓存的开启实例使用apache设置 1.apache配置文件搜索Addtype,我的addtype已经存在项目,如下 AddType application/x-compress .Z AddType application/x-gz...
捕捉模式从DOM最顶层一直到最后一层,冒泡正好相反,具体运行以下实例测试.<!DOCTYPE html> <html> <head> <title>捕捉和冒泡</title> <meta charset="...
<!-- 三个核心方法 openDatabase:这个方法使用现有数据库或创建...
开发需求如下,商品下单后需要指定送到日期:送达日期为周一 周三 周六 ,如果今天周一,用户选择周一即为下一周周一。代码如下:<html> <head> <meta charset="utf-8"> <title>...
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>获取mac地址</title> </head&g...