记录apicloud的tapmode用法

一、tapmode具有速点击事件功能,在触发事件中加入tapmode可以消除JS中标准click事件的300毫秒延迟;
二、tapmode具有触发可显示样式的效果,tapmode=’css样式类’属性,,当该元素touchstart touchmove的时候就会展现css样式。

eg:
这里写图片描述

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>设置</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <style>**重点内容**
    body{
      height: 12rem;
      width: 100%;
      background-color: #B0C4DE;
    }
    .ljl{
      width: 200px;
      height: 40px;
      border-radius: 10px;
      line-height: 40px;
      background-color: #ffcccc;
      margin: 0 auto;
      margin-top: 40px;
    }
    </style>
</head>
<body>
  <div class="ljl" tapmode onclick="yes()">请问你愿意和我共度余生吗</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    apiready = function() {
    };
  function yes() {
    alert("是的我愿意");
  }
</script>
</html>

猜你喜欢

转载自blog.csdn.net/longgeaisisi/article/details/81138095
今日推荐