zoukankan      html  css  js  c++  java
  • web -- Navigator.vibrate(); 使设备(有振动硬件)产生有频率的振动

    MDN 文档

    此方法需要用户手势。 否则,它返回false。

    const koa2 = require(`koa2`);
    const Router = require(`koa-router`);
    const router = new Router();
    const app = new koa2();
    
    const Index = router.get(`/`, async (ctx, next) =>{
      await next()
      ctx.status = 200;
      ctx.type= `html`;
      ctx.body = `
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <h1 id="h">hello2</h1>
        <script>
          document.getElementById('h').onclick = function(e){
             window.navigator.vibrate([200, 100]);
          }
        </script>
        `
    }).routes();
    app.use(Index);
    
    app.listen(1995);
    
  • 相关阅读:
    浮点数
    2020.07.13
    2020.07.07
    2020.07.06
    剑指offer(三)
    剑指offer(二)
    剑指offer
    堆排序
    归并排序
    希尔排序
  • 原文地址:https://www.cnblogs.com/ajanuw/p/8358624.html
Copyright © 2011-2022 走看看