記錄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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章